Skip to content

Revert "Simpler itemID finding for alpha. (#1967)" (#1993) #1079

Revert "Simpler itemID finding for alpha. (#1967)" (#1993)

Revert "Simpler itemID finding for alpha. (#1967)" (#1993) #1079

# 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]
include:
- runs-on: ubuntu-latest
compiler: gcc
gcc: 13
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set GCC & G++ compiler (on Linux)
run: echo "CC=gcc-${{matrix.gcc}}" >> $GITHUB_ENV && echo "CXX=g++-${{matrix.gcc}}" >> $GITHUB_ENV
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.x'
- name: Cache external dependencies
id: cache-ext
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
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@d06b37b47cfd043ec794ffa3e40e0b6b5858a7ec
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@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1
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 -DAVIF_ENABLE_WERROR=ON
-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@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
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."