ci: Attempt two #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ "master", "ci-tests", "more-image-plugins" ] | |
pull_request: | |
branches: [ "master", "ci-tests", "more-image-plugins" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
build_type: [Debug, Release] | |
c_compiler: [gcc, clang, cl] | |
# NOTE: | |
# While the idea of building with Clang on Ubuntu sounds nice on | |
# paper, in practice it's going to be a waste of time since most | |
# people don't build with it and we keep our C++ rather conservative | |
# for the moment anyway. Let's keep it disabled for now. | |
include: | |
- os: windows-latest | |
c_compiler: cl | |
cpp_compiler: cl | |
- os: ubuntu-latest | |
c_compiler: gcc | |
cpp_compiler: g++ | |
- os: macos-latest | |
c_compiler: clang | |
cpp_compiler: clang++ | |
exclude: | |
- os: windows-latest | |
c_compiler: gcc | |
- os: windows-latest | |
c_compiler: clang | |
- os: ubuntu-latest | |
c_compiler: clang | |
- os: ubuntu-latest | |
c_compiler: cl | |
- os: macos-latest | |
c_compiler: gcc | |
- os: macos-latest | |
c_compiler: cl | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
echo "build-install-dir=${{ github.workspace }}/build-install-prefix" >> "$GITHUB_OUTPUT" | |
[ "${{ matrix.cpp_compiler }}" = "cl" ] && echo "build-toolchain-opts=-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" >> "$GITHUB_OUTPUT" | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
# NOTE: We intentionally stick to our MINIMUM required version here | |
with: | |
version: 6.4.3 | |
cache: true | |
modules: qt5compat | |
- name: Prepare vcpkg | |
if: matrix.cpp_compiler == 'cl' | |
run: | | |
pushd C:\vcpkg | |
git fetch origin 8150939b69720adc475461978e07c2d2bf5fb76e | |
popd | |
- name: Configure Wespal | |
run: | | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} ${{ steps.strings.outputs.build-toolchain-opts }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} -DENABLE_BUILTIN_IMAGE_PLUGINS=ON -DENABLE_TESTS=ON ${{ steps.strings.outputs.cmake-extra-args }} -S ${{ github.workspace }} | |
- name: Build Wespal | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Run unit tests | |
run: ctest --test-dir ${{ steps.strings.outputs.build-output-dir }} --build-config ${{ matrix.build_type }} --output-on-failure | |
- name: Install Wespal (Linux only) | |
if: matrix.os == 'ubuntu-latest' | |
run: cmake --install ${{ steps.strings.outputs.build-output-dir }} |