Improve libaom error handling with shared helper function #25
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
| # This is a copy of ci-unix-shared-installed.yml for finding bugs when adding warnings. | |
| name: CI C conformance | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| # Cancel the workflow if a new one is triggered from the same PR, branch, or tag, except on main. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| build-shared-installed: | |
| strategy: | |
| fail-fast: false | |
| # Generate the configurations: | |
| # case 0: nodiscard | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| case: [0] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: ./.github/actions/setup-linux | |
| if: runner.os == 'Linux' | |
| with: | |
| codec-aom: "SYSTEM" | |
| codec-dav1d: "SYSTEM" | |
| libyuv: "SYSTEM" | |
| - uses: ./.github/actions/setup-windows | |
| id: windows_setup | |
| if: runner.os == 'Windows' | |
| with: | |
| codec-aom: "SYSTEM" | |
| codec-dav1d: "SYSTEM" | |
| libyuv: "SYSTEM" | |
| zlibpng: "SYSTEM" | |
| - name: Set clang as compiler on Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| echo "AVIF_CMAKE_C_COMPILER=-DCMAKE_C_COMPILER=clang" >> $GITHUB_ENV | |
| echo "AVIF_CMAKE_CXX_COMPILER=-DCMAKE_CXX_COMPILER=clang++" >> $GITHUB_ENV | |
| - name: Leave compiler as MSVC on Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| echo "AVIF_CMAKE_C_COMPILER=" >> $env:GITHUB_ENV | |
| echo "AVIF_CMAKE_CXX_COMPILER=" >> $env:GITHUB_ENV | |
| - name: Enable nodiscard | |
| if: ${{ matrix.case == 0}} | |
| run: echo "CMAKE_AVIF_FLAGS=\"-DAVIF_ENABLE_NODISCARD=ON\"" >> $GITHUB_ENV | |
| - name: Prepare libavif (cmake) | |
| run: > | |
| cmake ${{ steps.windows_setup.outputs.vcpkg-cmake-config }} -G Ninja -S . -B build | |
| -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON | |
| -DAVIF_CODEC_AOM=SYSTEM | |
| -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_AOM_ENCODE=ON | |
| -DAVIF_CODEC_DAV1D=SYSTEM | |
| -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON | |
| -DAVIF_BUILD_TESTS=ON -DAVIF_GTEST=LOCAL | |
| -DAVIF_BUILD_GDK_PIXBUF=ON -DCMAKE_INSTALL_PREFIX=./build/install | |
| -DAVIF_ENABLE_WERROR=ON ${{ env.AVIF_CMAKE_C_COMPILER}} ${{ env.AVIF_CMAKE_CXX_COMPILER }} | |
| ${{ env.CMAKE_AVIF_FLAGS }} | |
| - name: Build libavif | |
| run: cmake --build build --config Release --parallel 4 | |
| - name: Run AVIF Tests | |
| working-directory: ./build | |
| run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure |