Install Pillow together with the rest of our CI deps #5336
Workflow file for this run
This file contains hidden or 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: Regression testing | |
| on: | |
| - push | |
| - pull_request | |
| env: | |
| # Force colored output (see https://bixense.com/clicolors/ and https://force-color.org/) | |
| TERM: xterm-256color | |
| CLICOLOR: 1 | |
| CLICOLOR_FORCE: 1 | |
| CMAKE_COLOR_DIAGNOSTICS: ON # Tells CMake-generated build systems to have colored output. | |
| CMAKE_CONFIG_TYPE: Debug # `cmake --build` now implies `--config Debug`. | |
| # Approximate number of CPU cores in GitHub's runners as of 2026-03-18: | |
| # https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories | |
| CMAKE_BUILD_PARALLEL_LEVEL: 4 # `cmake --build` now implies `--parallel 4`. | |
| CMAKE_INSTALL_PARALLEL_LEVEL: 4 # `cmake --install` now implies `--parallel 4`. | |
| CTEST_PARALLEL_LEVEL: 0 # `ctest` now implies `--parallel 0` (number of logical CPUs). | |
| CTEST_NO_TESTS_ACTION: error # Make CTest fail if it cannot find any tests. (That should never happen.) | |
| CTEST_OUTPUT_ON_FAILURE: ON # CTest reports test program output on failure. | |
| GIT_CONFIG_COUNT: 1 | |
| GIT_CONFIG_KEY_0: color.ui | |
| GIT_CONFIG_VALUE_0: always # Colorful output is helpful even though CI is not considered to be a terminal. | |
| # We instruct CMake to download and build third-party projects outside of our source tree, | |
| # otherwise they can trigger `-Werror=dev` (from the `develop` preset). | |
| DEPS_ROOT_DIR: ~/_deps # Note that this needs to be used in a position where Bash will trigger tilde expansion! | |
| # We use bash syntax across OSes for consistency unless otherwise specified | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| unix: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, macos-14] | |
| cxx: [g++, clang++] | |
| buildsys: [make, cmake] | |
| exclude: | |
| - { os: macos-14, cxx: g++ } # Don't use `g++` on macOS; it's just an alias to `clang++`. | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Install deps | |
| run: | | |
| ./.github/scripts/install_deps.sh ${{ matrix.os }} | |
| - name: Build & install using Make | |
| if: matrix.buildsys == 'make' | |
| run: | | |
| make develop -kj Q= CXX=${{ matrix.cxx }} | |
| sudo make install -j Q= | |
| - name: Build & install using CMake | |
| if: matrix.buildsys == 'cmake' | |
| # Since GitHub's runners are basically kitchen sinks, | |
| # the Mono framework exposes a libpng 1.4.x header, breaking everything. | |
| # Searching frameworks last makes Homebrew's libpng be discovered first, which works. | |
| # Note that since this is specific to our CI environment, the workaround is | |
| # better applied here than in our CMakeLists, where it could affect and break someone else. | |
| run: | | |
| cmake -S . -B build --preset develop -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DTESTS_OS_NAME=${{ matrix.os }} | |
| cmake --build build --verbose | |
| sudo cmake --install build --verbose | |
| - name: Package binaries | |
| run: | | |
| mkdir bins | |
| cp rgb{asm,link,fix,gfx} bins | |
| - name: Upload binaries | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: rgbds-canary-${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.buildsys }} | |
| path: bins | |
| if-no-files-found: error | |
| - name: Compute test dependency cache params | |
| id: test-deps-cache-params | |
| run: | | |
| paths=$(test/fetch-test-deps.sh --get-paths) | |
| hash=$(test/fetch-test-deps.sh --get-hash) | |
| tee -a <<<"paths=\"${paths//,/\\n}\"" $GITHUB_OUTPUT | |
| tee -a <<<"hash=${hash%-}" $GITHUB_OUTPUT | |
| - name: Check test dependency repositories cache | |
| id: test-deps-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }} | |
| key: ${{ matrix.os }}-${{ steps.test-deps-cache-params.outputs.hash }} | |
| - name: Fetch test dependency repositories | |
| if: steps.test-deps-cache.outputs.cache-hit != 'true' | |
| continue-on-error: true | |
| run: | | |
| test/fetch-test-deps.sh | |
| - name: Run tests using our script | |
| if: matrix.buildsys == 'make' | |
| run: | | |
| CXX=${{ matrix.cxx }} test/run-tests.sh --os ${{ matrix.os }} | |
| - name: Run tests using CTest | |
| if: matrix.buildsys == 'cmake' | |
| run: | | |
| ctest --test-dir build --schedule-random | |
| macos-static: | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Install deps | |
| run: | | |
| ./.github/scripts/install_deps.sh macos | |
| - name: Cache library deps | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.DEPS_ROOT_DIR }}/*-tmp/ | |
| key: dep-srcs-${{ hashFiles('cmake/deps.cmake') }} | |
| enableCrossOsArchive: true | |
| - name: Build & install | |
| run: | | |
| cmake -S . -B build --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DTESTS_OS_NAME=macos | |
| cmake --build build | |
| - name: Package binaries | |
| run: | | |
| mkdir bins | |
| cp rgb{asm,link,fix,gfx} bins | |
| - name: Upload binaries | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: rgbds-canary-macos-static | |
| path: bins | |
| if-no-files-found: error | |
| - name: Compute test dependency cache params | |
| id: test-deps-cache-params | |
| run: | | |
| paths=$(test/fetch-test-deps.sh --get-paths) | |
| hash=$(test/fetch-test-deps.sh --get-hash) | |
| tee -a <<<"paths=\"${paths//,/\\n}\"" $GITHUB_OUTPUT | |
| tee -a <<<"hash=${hash%-}" $GITHUB_OUTPUT | |
| - name: Check test dependency repositories cache | |
| id: test-deps-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }} | |
| key: macos-14-${{ steps.test-deps-cache-params.outputs.hash }} | |
| - name: Fetch test dependency repositories | |
| if: steps.test-deps-cache.outputs.cache-hit != 'true' | |
| continue-on-error: true | |
| run: | | |
| test/fetch-test-deps.sh | |
| - name: Run tests | |
| run: | | |
| ctest --test-dir build --schedule-random | |
| windows: | |
| strategy: | |
| matrix: | |
| bits: [32, 64] | |
| os: [windows-2022, windows-2025] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Install deps | |
| run: | | |
| bash .github/scripts/install_deps.sh ${{ matrix.os }} | |
| - name: Cache library deps | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.DEPS_ROOT_DIR }}/*-tmp/ | |
| key: dep-srcs-${{ hashFiles('cmake/deps.cmake') }} | |
| enableCrossOsArchive: true | |
| - name: Build Windows binaries | |
| run: | # ASan seems to be broken on Windows, so we disable it. | |
| cmake -S . -B build --preset develop-msvc${{ matrix.bits }} -DSANITIZERS=OFF \ | |
| -DTESTS_OS_NAME=${{ matrix.os }} -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" | |
| cmake --build build | |
| - name: Package binaries | |
| working-directory: build | |
| run: | | |
| cpack -DCPACK_PACKAGE_FILE_NAME=rgbds-win${{ matrix.bits }} -G ZIP -C Debug --verbose | |
| - name: Upload Windows binaries | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: rgbds-canary-w${{ matrix.bits }}-${{ matrix.os }} | |
| path: build/rgbds-win${{ matrix.bits }}.zip | |
| if-no-files-found: error | |
| - name: Compute test dependency cache params | |
| id: test-deps-cache-params | |
| run: | | |
| paths=$(test/fetch-test-deps.sh --get-paths) | |
| hash=$(test/fetch-test-deps.sh --get-hash) | |
| tee -a <<<"paths=\"${paths//,/\\n}\"" $GITHUB_OUTPUT | |
| tee -a <<<"hash=${hash%-}" $GITHUB_OUTPUT | |
| - name: Check test dependency repositories cache | |
| id: test-deps-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }} | |
| key: ${{ matrix.os }}-${{ matrix.bits }}-${{ steps.test-deps-cache-params.outputs.hash }} | |
| - name: Fetch test dependency repositories | |
| if: steps.test-deps-cache.outputs.cache-hit != 'true' | |
| continue-on-error: true | |
| run: | | |
| test/fetch-test-deps.sh | |
| - name: Run tests using CTest | |
| run: | | |
| ctest --test-dir build --schedule-random -C Debug | |
| windows-mingw-build: | |
| strategy: | |
| matrix: | |
| bits: [32, 64] | |
| include: | |
| - bits: 32 | |
| arch: i686 | |
| triplet: i686-w64-mingw32 | |
| - bits: 64 | |
| arch: x86-64 | |
| triplet: x86_64-w64-mingw32 | |
| fail-fast: false | |
| runs-on: ubuntu-22.04 | |
| env: | |
| DIST_DIR: win${{ matrix.bits }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Install deps | |
| run: | | |
| ./.github/scripts/install_deps.sh ubuntu | |
| - name: Install MinGW | |
| run: | # dpkg-dev is apparently required for pkg-config for cross-building | |
| sudo apt-get install g++-mingw-w64-${{ matrix.arch }}-win32 mingw-w64-tools libz-mingw-w64-dev dpkg-dev | |
| - name: Install libpng dev headers for MinGW | |
| run: | | |
| ./.github/scripts/mingw-w64-libpng-dev.sh ${{ matrix.triplet }} | |
| - name: Cross-build Windows binaries | |
| run: | | |
| make mingw${{ matrix.bits }} -kj Q= | |
| - name: Package binaries | |
| run: | # DLL dependencies can be figured out using e.g. Dependency Walker or objdump -p | |
| mkdir bins | |
| mv -v rgb{asm,link,fix,gfx}.exe bins/ | |
| cp -v /usr/${{ matrix.triplet }}/lib/zlib1.dll bins | |
| cp -v /usr/${{ matrix.triplet }}/bin/libpng16-16.dll bins | |
| cp -v /usr/lib/gcc/${{ matrix.triplet }}/10-win32/lib{ssp-0,stdc++-6}.dll bins | |
| [ "${{ matrix.bits }}" -ne 32 ] || cp -v /usr/lib/gcc/${{ matrix.triplet }}/10-win32/libgcc_s_dw2-1.dll bins | |
| - name: Upload Windows binaries | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: rgbds-canary-mingw-win${{ matrix.bits }} | |
| path: bins | |
| if-no-files-found: error | |
| - name: Upload Windows test binaries | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: testing-programs-mingw-win${{ matrix.bits }} | |
| path: | | |
| test/gfx/randtilegen.exe | |
| test/gfx/rgbgfx_test.exe | |
| if-no-files-found: error | |
| windows-mingw-testing: | |
| needs: windows-mingw-build | |
| strategy: | |
| matrix: | |
| os: [windows-2022, windows-2025] | |
| bits: [32, 64] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Retrieve binaries | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: rgbds-canary-mingw-win${{ matrix.bits }} | |
| path: bins | |
| - name: Retrieve test binaries | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: testing-programs-mingw-win${{ matrix.bits }} | |
| path: test/gfx | |
| - name: Extract binaries | |
| run: | | |
| cp bins/* . | |
| cp bins/*.dll test/gfx | |
| - name: Compute test dependency cache params | |
| id: test-deps-cache-params | |
| run: | | |
| paths=$(test/fetch-test-deps.sh --get-paths) | |
| hash=$(test/fetch-test-deps.sh --get-hash) | |
| tee -a <<<"paths=\"${paths//,/\\n}\"" $GITHUB_OUTPUT | |
| tee -a <<<"hash=${hash%-}" $GITHUB_OUTPUT | |
| - name: Check test dependency repositories cache | |
| id: test-deps-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }} | |
| key: mingw-${{ matrix.bits }}-${{ steps.test-deps-cache-params.outputs.hash }} | |
| - name: Fetch test dependency repositories | |
| if: steps.test-deps-cache.outputs.cache-hit != 'true' | |
| continue-on-error: true | |
| run: | | |
| test/fetch-test-deps.sh | |
| - name: Run tests | |
| run: | | |
| test/run-tests.sh --os ${{ matrix.os }} | |
| cygwin: | |
| strategy: | |
| matrix: | |
| bits: [32, 64] | |
| include: | |
| - bits: 32 | |
| arch: x86 | |
| - bits: 64 | |
| arch: x86_64 | |
| fail-fast: false | |
| runs-on: windows-2022 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Setup Cygwin | |
| uses: cygwin/cygwin-install-action@v6 | |
| with: | |
| platform: ${{ matrix.arch }} | |
| packages: >- | |
| bison | |
| gcc-g++ | |
| git | |
| libpng-devel | |
| make | |
| pkg-config | |
| - name: Build & install using Make | |
| shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -o igncr '{0}' | |
| run: | # Cygwin does not support `make develop` sanitizers ASan or UBSan | |
| make -kj Q= | |
| make install -j Q= | |
| - name: Run tests | |
| shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -o igncr '{0}' | |
| run: | | |
| test/run-tests.sh --only-internal | |
| freebsd: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Build & test using CMake on FreeBSD | |
| uses: vmactions/freebsd-vm@v1 | |
| with: | |
| envs: >- | |
| TERM CLICOLOR CLICOLOR_FORCE | |
| CMAKE_COLOR_DIAGNOSTICS CMAKE_CONFIG_TYPE | |
| CMAKE_BUILD_PARALLEL_LEVEL CTEST_PARALLEL_LEVEL | |
| CTEST_NO_TESTS_ACTION CTEST_OUTPUT_ON_FAILURE | |
| GIT_CONFIG_COUNT GIT_CONFIG_KEY_0 GIT_CONFIG_VALUE_0 | |
| release: "14.3" | |
| usesh: true | |
| prepare: | | |
| .github/scripts/install_deps.sh freebsd | |
| run: | # Leak detection is not supported on FreeBSD, so disable it. | |
| cmake -S . -B build --preset develop -DTESTS_OS_NAME=freebsd | |
| cmake --build build --verbose | |
| ASAN_OPTIONS=detect_leaks=0 ctest --test-dir build --schedule-random --label-exclude external | |
| cmake --install build --verbose |