blob: ef53c9b23b74d03f3df9b1e2ea95a02256fbdbd9 [file] [log] [blame]
# Workflow that builds libabvif with aom and libyuv, also builds MP4box,
# and runs tests with "golden" in their name. Test results are saved as artifacts
# which can be downloaded from GitHub'S UI or with 'gh run download'.
name: CI Linux Golden Tests
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-run-golden-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set GCC & G++ 10 compiler (on Linux)
run: echo "CC=gcc-10" >> $GITHUB_ENV && echo "CXX=g++-10" >> $GITHUB_ENV
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.x'
- name: Cache external dependencies
id: cache-ext
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ext
key: ${{ runner.os }}-golden-tests-${{ hashFiles('ext/aom.cmd', 'ext/libyuv.cmd', 'ext/libxml2.cmd', 'ext/mp4box.sh') }}
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@187efd9581ed20ee4e03c0dfb9ac2cd5896c4835
with:
# CMake 3.18 or higher is required for libxml2
cmake-version: '3.18.x'
- name: Print cmake version
run: cmake --version
- uses: ilammy/setup-nasm@321e6ed62a1fc77024a3bd853deb33645e8b22c4 # v1.4.0
with:
version: 2.15.05
- uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
- name: Build aom
if: steps.cache-ext.outputs.cache-hit != 'true'
working-directory: ./ext
run: bash -e aom.cmd
- name: Build libyuv
if: steps.cache-ext.outputs.cache-hit != 'true'
working-directory: ./ext
run: bash -e libyuv.cmd
- name: Build libxml2
if: steps.cache-ext.outputs.cache-hit != 'true'
working-directory: ./ext
run: bash -e libxml2.cmd
- name: Build mp4box
if: steps.cache-ext.outputs.cache-hit != 'true'
working-directory: ./ext
run: bash -e mp4box.sh
- name: Prepare libavif (cmake)
run: >
mkdir build && cd build
cmake .. -G Ninja
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF
-DAVIF_CODEC_AOM=LOCAL -DAVIF_LIBYUV=LOCAL
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON
-DAVIF_LOCAL_LIBXML2=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GOLDEN_TESTS=ON
-DAVIF_ENABLE_GTEST=OFF
-DGOLDEN_TESTS_OUTPUT_DIR=${{ runner.temp }}/golden_tests
- name: Build libavif (ninja)
working-directory: ./build
run: ninja
- name: Run AVIF golden tests
working-directory: ./build
# Runs test that have "golden" in their name.
run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure -R golden
# See https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
- name: Archive golden tests output for debugging
if: failure()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: golden-tests-output
path: ${{ runner.temp }}/golden_tests/**/*
# Print instructions to help fix the tests.
- name: How to fix failing tests
if: failure()
run: >
echo "If the tests fail, download the test results from the Artifacts list at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} or with:
gh run download --dir /tmp/golden-tests-output-${{ github.run_id }} --repo ${{ github.repository }} --name golden-tests-output ${{ github.run_id }}
Update all files with:
cp /tmp/golden-tests-output-${{ github.run_id }}/*/*.xml ~/git/libavif/tests/data/goldens
Or look at detailed instructions in the README.txt file in the test ouputs."