diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 889c0504b1..47a8a8adbf 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -1,14 +1,14 @@ -name: 'Cache for all OSes' -description: 'Needs to be called before any call to ext/.cmd|sh or cmake' +name: "Cache for all OSes" +description: "Needs to be called before any call to ext/.cmd|sh or cmake" inputs: extra-key: - description: 'Extra cache key to use in the cache name. Useful when several caches are used in one workflow.' - default: '' + description: "Extra cache key to use in the cache name. Useful when several caches are used in one workflow." + default: "" use-meson: - description: 'Whether meson is used' + description: "Whether meson is used" default: false use-rust: - description: 'Whether rust is used' + description: "Whether rust is used" default: false outputs: ext-cache-hit: diff --git a/.github/actions/setup-common/action.yml b/.github/actions/setup-common/action.yml index f7074a0bb7..dcc454eec4 100644 --- a/.github/actions/setup-common/action.yml +++ b/.github/actions/setup-common/action.yml @@ -1,31 +1,31 @@ -name: 'Common setup for all OSes' -description: 'Installs common dependencies' +name: "Common setup for all OSes" +description: "Installs common dependencies" inputs: codec-aom: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" codec-dav1d: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" codec-rav1e: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" oldest-cmake: - description: 'Can take the values: true, false. Only useful on Linux to force using the minimum required CMake' - default: 'false' + description: "Can take the values: true, false. Only useful on Linux to force using the minimum required CMake" + default: "false" runs: using: "composite" steps: - name: Set up Python uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: - python-version: '3.x' + python-version: "3.x" - name: Set up CMake 3.13 if: ${{ runner.os == 'Linux' && inputs.oldest-cmake == 'true' }} uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2 with: # Use the minimum required version of cmake. - cmake-version: '3.13.x' + cmake-version: "3.13.x" - name: Print CMake version run: cmake --version shell: bash diff --git a/.github/actions/setup-linux/action.yml b/.github/actions/setup-linux/action.yml index f183e77100..dfb66c207c 100644 --- a/.github/actions/setup-linux/action.yml +++ b/.github/actions/setup-linux/action.yml @@ -1,33 +1,33 @@ -name: 'Setup on Linux' -description: 'Installs dependencies and sets env variables specific to Linux' +name: "Setup on Linux" +description: "Installs dependencies and sets env variables specific to Linux" inputs: codec-aom: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" codec-dav1d: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - edfault: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + edfault: "OFF" codec-rav1e: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" extra-cache-key: - description: 'Extra cache key to use in the cache name. Useful when several caches are used in one workflow.' - default: '' + description: "Extra cache key to use in the cache name. Useful when several caches are used in one workflow." + default: "" gcc-version: - description: 'Can be empty, in which case CC and CXX are not overriden' - default: '' + description: "Can be empty, in which case CC and CXX are not overriden" + default: "" gtest: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" libxml2: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" libyuv: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" oldest-cmake: - description: 'Can take the values: true, false' - default: 'false' + description: "Can take the values: true, false" + default: "false" outputs: ext-cache-hit: value: ${{ steps.cache.outputs.ext-cache-hit }} @@ -41,38 +41,31 @@ runs: shell: bash - name: Install libaom library if: ${{ inputs.codec-aom == 'SYSTEM' }} - run: - sudo apt install -y libaom-dev + run: sudo apt install -y libaom-dev shell: bash - name: Install libdav1d library if: ${{ inputs.codec-dav1d == 'SYSTEM' }} - run: - sudo apt install -y libdav1d-dev + run: sudo apt install -y libdav1d-dev shell: bash - name: Install rav1e library if: ${{ inputs.codec-rav1e == 'SYSTEM' }} - run: - sudo apt install -y librav1e-dev + run: sudo apt install -y librav1e-dev shell: bash - name: Install libxml2 library if: ${{ inputs.libxml2 == 'SYSTEM' }} - run: - sudo apt install -y libxml2 + run: sudo apt install -y libxml2 shell: bash - name: Install libyuv library if: ${{ inputs.libyuv == 'SYSTEM' }} - run: - sudo apt install -y libyuv-dev + run: sudo apt install -y libyuv-dev shell: bash - name: Set up meson if: ${{ inputs.codec-dav1d == 'LOCAL' }} - run: - sudo apt install -y meson + run: sudo apt install -y meson shell: bash - name: Set up gtest if: ${{ inputs.gtest == 'SYSTEM' }} - run: - sudo apt install -y libgtest-dev + run: sudo apt install -y libgtest-dev shell: bash - uses: ./.github/actions/setup-common diff --git a/.github/actions/setup-macos/action.yml b/.github/actions/setup-macos/action.yml index ad215b381b..84586bcd5d 100644 --- a/.github/actions/setup-macos/action.yml +++ b/.github/actions/setup-macos/action.yml @@ -1,21 +1,21 @@ -name: 'Setup on macOS' -description: 'Installs dependencies specific to macOS' +name: "Setup on macOS" +description: "Installs dependencies specific to macOS" inputs: codec-aom: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" codec-dav1d: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" codec-rav1e: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" gtest: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" extra-cache-key: - description: 'Extra cache key to use in the cache name. Useful when several caches are used in one workflow.' - default: '' + description: "Extra cache key to use in the cache name. Useful when several caches are used in one workflow." + default: "" outputs: ext-cache-hit: value: ${{ steps.cache.outputs.ext-cache-hit }} diff --git a/.github/actions/setup-windows/action.yml b/.github/actions/setup-windows/action.yml index 07a3a48125..2e150449d8 100644 --- a/.github/actions/setup-windows/action.yml +++ b/.github/actions/setup-windows/action.yml @@ -1,18 +1,18 @@ -name: 'Setup on Windows' -description: 'Installs dependencies specific to Windows' +name: "Setup on Windows" +description: "Installs dependencies specific to Windows" inputs: codec-aom: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" codec-dav1d: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" codec-rav1e: - description: 'Can take the values: OFF, LOCAL, SYSTEM' - default: 'OFF' + description: "Can take the values: OFF, LOCAL, SYSTEM" + default: "OFF" extra-cache-key: - description: 'Extra cache key to use in the cache name. Useful when several caches are used in one workflow.' - default: '' + description: "Extra cache key to use in the cache name. Useful when several caches are used in one workflow." + default: "" outputs: ext-cache-hit: value: ${{ steps.cache.outputs.ext-cache-hit }} diff --git a/.github/workflows/ci-android-emulator-tests.yml b/.github/workflows/ci-android-emulator-tests.yml index 71829f2e50..9077e58cfd 100644 --- a/.github/workflows/ci-android-emulator-tests.yml +++ b/.github/workflows/ci-android-emulator-tests.yml @@ -4,12 +4,12 @@ on: branches: - main paths: - - '.github/workflows/ci-android-emulator-tests.yml' - - 'android_jni/**' + - ".github/workflows/ci-android-emulator-tests.yml" + - "android_jni/**" pull_request: paths: - - '.github/workflows/ci-android-emulator-tests.yml' - - 'android_jni/**' + - ".github/workflows/ci-android-emulator-tests.yml" + - "android_jni/**" permissions: contents: read @@ -44,14 +44,14 @@ jobs: add-to-path: false - uses: ./.github/actions/setup-linux with: - codec-dav1d: 'LOCAL' - libyuv: 'LOCAL' + codec-dav1d: "LOCAL" + libyuv: "LOCAL" oldest-cmake: true - name: Setup JDK uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2 with: - java-version: '17' - distribution: 'temurin' + java-version: "17" + distribution: "temurin" - name: Run Instrumented Tests on the Emulator uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # v2.32.0 with: diff --git a/.github/workflows/ci-android-jni.yml b/.github/workflows/ci-android-jni.yml index 38a1366a71..b506ec0229 100644 --- a/.github/workflows/ci-android-jni.yml +++ b/.github/workflows/ci-android-jni.yml @@ -27,8 +27,8 @@ jobs: add-to-path: false - uses: ./.github/actions/setup-linux with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" - name: Setup JDK uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2 with: diff --git a/.github/workflows/ci-disable-gtest.yml b/.github/workflows/ci-disable-gtest.yml index 4eb7d06ed3..bfd7169259 100644 --- a/.github/workflows/ci-disable-gtest.yml +++ b/.github/workflows/ci-disable-gtest.yml @@ -9,10 +9,10 @@ on: push: pull_request: paths: - - '.github/workflows/ci-disable-gtest.yml' - - '**CMakeLists.txt' - - 'cmake/**' - - 'ext/**' + - ".github/workflows/ci-disable-gtest.yml" + - "**CMakeLists.txt" + - "cmake/**" + - "ext/**" permissions: contents: read @@ -35,28 +35,28 @@ jobs: gcc: 14 steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - codec-rav1e: 'LOCAL' - gcc-version: ${{ matrix.gcc }} - libyuv: 'LOCAL' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + codec-rav1e: "LOCAL" + gcc-version: ${{ matrix.gcc }} + libyuv: "LOCAL" - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL - -DAVIF_CODEC_RAV1E=LOCAL -DAVIF_CODEC_SVT=LOCAL - -DAVIF_LIBYUV=LOCAL -DAVIF_LIBSHARPYUV=LOCAL - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=OFF - -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL + -DAVIF_CODEC_RAV1E=LOCAL -DAVIF_CODEC_SVT=LOCAL + -DAVIF_LIBYUV=LOCAL -DAVIF_LIBSHARPYUV=LOCAL + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=OFF + -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure diff --git a/.github/workflows/ci-fuzztest.yml b/.github/workflows/ci-fuzztest.yml index 40352d9072..9d7302205d 100644 --- a/.github/workflows/ci-fuzztest.yml +++ b/.github/workflows/ci-fuzztest.yml @@ -27,39 +27,39 @@ jobs: name: build-shared-local-fuzztest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - id: setup - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - libxml2: 'LOCAL' - libyuv: ${{ matrix.libyuv }} - - name: Build fuzztest - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: bash -e fuzztest.cmd + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + id: setup + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + libxml2: "LOCAL" + libyuv: ${{ matrix.libyuv }} + - name: Build fuzztest + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: bash -e fuzztest.cmd - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON - -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL - -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL - -DAVIF_LIBYUV=${{ matrix.libyuv }} - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON - -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON - -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON - -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON - -DAVIF_ENABLE_FUZZTEST=ON - -DAVIF_LOCAL_FUZZTEST=ON - -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ - -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run fuzztest AVIF Tests - working-directory: ./build - run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure -R fuzztest + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON + -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL + -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL + -DAVIF_LIBYUV=${{ matrix.libyuv }} + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON + -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON + -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON + -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON + -DAVIF_ENABLE_FUZZTEST=ON + -DAVIF_LOCAL_FUZZTEST=ON + -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run fuzztest AVIF Tests + working-directory: ./build + run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure -R fuzztest diff --git a/.github/workflows/ci-linux-golden-tests.yml b/.github/workflows/ci-linux-golden-tests.yml index dee00343e9..9cc98000e9 100644 --- a/.github/workflows/ci-linux-golden-tests.yml +++ b/.github/workflows/ci-linux-golden-tests.yml @@ -26,53 +26,53 @@ jobs: gcc: 14 steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - id: setup - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - gcc-version: ${{ matrix.gcc }} - libxml2: 'LOCAL' - libyuv: 'LOCAL' - - name: Build mp4box - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: bash -e mp4box.sh + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + id: setup + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + gcc-version: ${{ matrix.gcc }} + libxml2: "LOCAL" + libyuv: "LOCAL" + - name: Build mp4box + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: bash -e mp4box.sh - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -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_LIBXML2=LOCAL - -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 + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -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_LIBXML2=LOCAL + -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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - with: - name: golden-tests-output - path: ${{ runner.temp }}/golden_tests/**/* + # 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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.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." + # 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." diff --git a/.github/workflows/ci-linux-static-old-local.yml b/.github/workflows/ci-linux-static-old-local.yml index a768cb3cab..7208d7a93a 100644 --- a/.github/workflows/ci-linux-static-old-local.yml +++ b/.github/workflows/ci-linux-static-old-local.yml @@ -3,10 +3,10 @@ on: push: pull_request: paths: - - '.github/workflows/ci-linux-static-old-local.yml' - - '**CMakeLists.txt' - - 'cmake/**' - - 'ext/**' + - ".github/workflows/ci-linux-static-old-local.yml" + - "**CMakeLists.txt" + - "cmake/**" + - "ext/**" permissions: contents: read @@ -29,41 +29,41 @@ jobs: gcc: 14 steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - codec-rav1e: 'LOCAL' - gcc-version: ${{ matrix.gcc }} - libxml2: 'LOCAL' - libyuv: 'LOCAL' - - name: Prepare libavif (cmake) - run: > - cmake .. -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON - -DAVIF_CODEC_DAV1D=ON -DAVIF_LOCAL_DAV1D=ON - -DAVIF_CODEC_RAV1E=ON -DAVIF_LOCAL_RAV1E=ON - -DAVIF_CODEC_SVT=ON -DAVIF_LOCAL_SVT=ON - -DAVIF_CODEC_LIBGAV1=ON -DAVIF_LOCAL_LIBGAV1=ON - -DAVIF_LOCAL_LIBSHARPYUV=ON -DAVIF_LOCAL_LIBXML2=ON -DAVIF_LOCAL_LIBYUV=ON - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_LOCAL_GTEST=ON - -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON - -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON - -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON - -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure - - name: Check static link bundling - run: | - cc -o avifenc -I./apps/shared -I./third_party/iccjpeg -I./include apps/avifenc.c \ - apps/shared/*.c third_party/iccjpeg/iccjpeg.c build/libavif.a \ - -lpng -ljpeg -lz -lm -ldl -lstdc++ + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + codec-rav1e: "LOCAL" + gcc-version: ${{ matrix.gcc }} + libxml2: "LOCAL" + libyuv: "LOCAL" + - name: Prepare libavif (cmake) + run: > + cmake .. -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON + -DAVIF_CODEC_DAV1D=ON -DAVIF_LOCAL_DAV1D=ON + -DAVIF_CODEC_RAV1E=ON -DAVIF_LOCAL_RAV1E=ON + -DAVIF_CODEC_SVT=ON -DAVIF_LOCAL_SVT=ON + -DAVIF_CODEC_LIBGAV1=ON -DAVIF_LOCAL_LIBGAV1=ON + -DAVIF_LOCAL_LIBSHARPYUV=ON -DAVIF_LOCAL_LIBXML2=ON -DAVIF_LOCAL_LIBYUV=ON + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_LOCAL_GTEST=ON + -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON + -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON + -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON + -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure + - name: Check static link bundling + run: | + cc -o avifenc -I./apps/shared -I./third_party/iccjpeg -I./include apps/avifenc.c \ + apps/shared/*.c third_party/iccjpeg/iccjpeg.c build/libavif.a \ + -lpng -ljpeg -lz -lm -ldl -lstdc++ - ./avifenc --help + ./avifenc --help diff --git a/.github/workflows/ci-mingw.yml b/.github/workflows/ci-mingw.yml index 7d910e20da..1884a3969d 100644 --- a/.github/workflows/ci-mingw.yml +++ b/.github/workflows/ci-mingw.yml @@ -27,46 +27,46 @@ jobs: run: shell: msys2 {0} steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: msys2/setup-msys2@v2 - with: - msystem: ${{ matrix.sys }} - update: true - install: >- - git - pacboy: >- - aom:p - cmake:p - diffutils:p - cc:p - dav1d:p - imagemagick:p - libjpeg-turbo:p - libpng:p - libyuv:p - ninja:p - zlib:p - - uses: ./.github/actions/cache - with: - extra-key: ${{ matrix.sys }} - - name: Print cmake version - run: cmake --version + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.sys }} + update: true + install: >- + git + pacboy: >- + aom:p + cmake:p + diffutils:p + cc:p + dav1d:p + imagemagick:p + libjpeg-turbo:p + libpng:p + libyuv:p + ninja:p + zlib:p + - uses: ./.github/actions/cache + with: + extra-key: ${{ matrix.sys }} + - name: Print cmake version + run: cmake --version - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AOM=SYSTEM - -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_AOM_ENCODE=ON - -DAVIF_CODEC_DAV1D=SYSTEM - -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBYUV=SYSTEM - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_BUILD_GDK_PIXBUF=ON - -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j --output-on-failure + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AOM=SYSTEM + -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_AOM_ENCODE=ON + -DAVIF_CODEC_DAV1D=SYSTEM + -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBYUV=SYSTEM + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_BUILD_GDK_PIXBUF=ON + -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j --output-on-failure diff --git a/.github/workflows/ci-unix-artifacts.yml b/.github/workflows/ci-unix-artifacts.yml index b6dbc298af..fdb79d0f85 100644 --- a/.github/workflows/ci-unix-artifacts.yml +++ b/.github/workflows/ci-unix-artifacts.yml @@ -17,53 +17,53 @@ jobs: os: [ubuntu-latest] # TODO: macos-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - if: runner.os == 'Linux' - with: - codec-aom: "LOCAL" - codec-dav1d: "LOCAL" - libyuv: "LOCAL" - - uses: ./.github/actions/setup-macos - if: runner.os == 'macOS' - with: - codec-aom: "LOCAL" - codec-dav1d: "LOCAL" + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + if: runner.os == 'Linux' + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + libyuv: "LOCAL" + - uses: ./.github/actions/setup-macos + if: runner.os == 'macOS' + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_AOM_ENCODE=ON - -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_DAV1D=LOCAL - -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBYUV=LOCAL - -DAVIF_ZLIBPNG=LOCAL -DAVIF_JPEG=LOCAL - -DAVIF_BUILD_EXAMPLES=OFF -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=OFF -DAVIF_ENABLE_WERROR=ON - -DCMAKE_C_COMPILER=clang - -DCMAKE_C_FLAGS_RELEASE="-static" -DCMAKE_EXE_LINKER_FLAGS="-static" - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Archive artifacts - uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # 0.7.6 - with: - type: zip - filename: ${{ matrix.os }}-artifacts.zip - directory: build - path: | - avifenc - avifdec - - name: Upload artifacts - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # See https://docs.github.com/en/webhooks/webhook-events-and-payloads#release. - upload_url: ${{ github.event.release.upload_url }} - asset_path: build/${{ matrix.os }}-artifacts.zip - asset_name: ${{ matrix.os }}-artifacts.zip - asset_content_type: application/zip + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_AOM_ENCODE=ON + -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_DAV1D=LOCAL + -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBYUV=LOCAL + -DAVIF_ZLIBPNG=LOCAL -DAVIF_JPEG=LOCAL + -DAVIF_BUILD_EXAMPLES=OFF -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=OFF -DAVIF_ENABLE_WERROR=ON + -DCMAKE_C_COMPILER=clang + -DCMAKE_C_FLAGS_RELEASE="-static" -DCMAKE_EXE_LINKER_FLAGS="-static" + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Archive artifacts + uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # 0.7.6 + with: + type: zip + filename: ${{ matrix.os }}-artifacts.zip + directory: build + path: | + avifenc + avifdec + - name: Upload artifacts + uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # See https://docs.github.com/en/webhooks/webhook-events-and-payloads#release. + upload_url: ${{ github.event.release.upload_url }} + asset_path: build/${{ matrix.os }}-artifacts.zip + asset_name: ${{ matrix.os }}-artifacts.zip + asset_content_type: application/zip # Use the following instead of the above to test this workflow outside of a release event. # - name: Upload artifacts diff --git a/.github/workflows/ci-unix-shared-installed.yml b/.github/workflows/ci-unix-shared-installed.yml index 5597c23a08..59ec7dd540 100644 --- a/.github/workflows/ci-unix-shared-installed.yml +++ b/.github/workflows/ci-unix-shared-installed.yml @@ -34,77 +34,77 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - if: runner.os == 'Linux' - with: - codec-aom: 'SYSTEM' - codec-dav1d: 'SYSTEM' - gcc-version: ${{ matrix.gcc }} - gtest: 'SYSTEM' - libyuv: 'SYSTEM' - oldest-cmake: ${{ matrix.oldest-cmake }} - - uses: ./.github/actions/setup-macos - if: runner.os == 'macOS' - with: - codec-aom: 'SYSTEM' - codec-dav1d: 'SYSTEM' - gtest: 'SYSTEM' - - name: Disable libyuv on macOS - # TODO(yguyon): Install libyuv (not available with brew). - if: runner.os == 'macOS' - run: echo "CMAKE_AVIF_FLAGS=\"-DAVIF_LIBYUV=OFF\"" >> $GITHUB_ENV + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + if: runner.os == 'Linux' + with: + codec-aom: "SYSTEM" + codec-dav1d: "SYSTEM" + gcc-version: ${{ matrix.gcc }} + gtest: "SYSTEM" + libyuv: "SYSTEM" + oldest-cmake: ${{ matrix.oldest-cmake }} + - uses: ./.github/actions/setup-macos + if: runner.os == 'macOS' + with: + codec-aom: "SYSTEM" + codec-dav1d: "SYSTEM" + gtest: "SYSTEM" + - name: Disable libyuv on macOS + # TODO(yguyon): Install libyuv (not available with brew). + if: runner.os == 'macOS' + run: echo "CMAKE_AVIF_FLAGS=\"-DAVIF_LIBYUV=OFF\"" >> $GITHUB_ENV - - name: Prepare libavif (cmake) - run: > - cmake -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_ENABLE_GTEST=ON -DAVIF_GTEST=SYSTEM - -DAVIF_BUILD_GDK_PIXBUF=ON -DCMAKE_INSTALL_PREFIX=./build/install - -DAVIF_ENABLE_WERROR=ON ${{ env.CMAKE_AVIF_FLAGS }} - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure - - name: Install AVIF - working-directory: ./build - run: ninja install - - name: Test installed cmake - working-directory: ./build - run: > - mkdir test && cd test + - name: Prepare libavif (cmake) + run: > + cmake -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_ENABLE_GTEST=ON -DAVIF_GTEST=SYSTEM + -DAVIF_BUILD_GDK_PIXBUF=ON -DCMAKE_INSTALL_PREFIX=./build/install + -DAVIF_ENABLE_WERROR=ON ${{ env.CMAKE_AVIF_FLAGS }} + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure + - name: Install AVIF + working-directory: ./build + run: ninja install + - name: Test installed cmake + working-directory: ./build + run: > + mkdir test && cd test - echo "cmake_minimum_required(VERSION 3.13) - project(FindPackageTest) - message(STATUS ${CMAKE_PREFIX_PATH}) - find_package(libavif REQUIRED) - if(TARGET avif) - message(STATUS "\""avif found"\"") - else() - message(FATAL_ERROR "\""avif not found"\"") - endif()" >> CMakeLists.txt + echo "cmake_minimum_required(VERSION 3.13) + project(FindPackageTest) + message(STATUS ${CMAKE_PREFIX_PATH}) + find_package(libavif REQUIRED) + if(TARGET avif) + message(STATUS "\""avif found"\"") + else() + message(FATAL_ERROR "\""avif not found"\"") + endif()" >> CMakeLists.txt - cmake . -DCMAKE_PREFIX_PATH=../install - - name: Prepare libavif with [[nodiscard]] (cmake) - # CMake 3.21 is needed to force C23 for [[nodiscard]]. - if: runner.oldest-cmake == 'false' - run: > - cmake -G Ninja -S . -B build_nodiscard - -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_ENABLE_NODISCARD=ON -DAVIF_ENABLE_WERROR=ON - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_BUILD_GDK_PIXBUF=ON ${{ env.CMAKE_AVIF_FLAGS }} - - name: Build libavif with [[nodiscard]] (ninja) - if: runner.oldest-cmake == 'false' - working-directory: ./build_nodiscard - run: ninja + cmake . -DCMAKE_PREFIX_PATH=../install + - name: Prepare libavif with [[nodiscard]] (cmake) + # CMake 3.21 is needed to force C23 for [[nodiscard]]. + if: runner.oldest-cmake == 'false' + run: > + cmake -G Ninja -S . -B build_nodiscard + -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_ENABLE_NODISCARD=ON -DAVIF_ENABLE_WERROR=ON + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_BUILD_GDK_PIXBUF=ON ${{ env.CMAKE_AVIF_FLAGS }} + - name: Build libavif with [[nodiscard]] (ninja) + if: runner.oldest-cmake == 'false' + working-directory: ./build_nodiscard + run: ninja diff --git a/.github/workflows/ci-unix-shared-local.yml b/.github/workflows/ci-unix-shared-local.yml index 4cf37f2a1f..6a78bb7aee 100644 --- a/.github/workflows/ci-unix-shared-local.yml +++ b/.github/workflows/ci-unix-shared-local.yml @@ -30,38 +30,38 @@ jobs: name: build-shared-local (${{ matrix.os }}, libyuv ${{ matrix.libyuv }}) steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - if: runner.os == 'Linux' - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - gcc-version: ${{ matrix.gcc }} - libxml2: 'LOCAL' - libyuv: ${{ matrix.libyuv }} - - uses: ./.github/actions/setup-macos - if: runner.os == 'macOS' - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + if: runner.os == 'Linux' + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + gcc-version: ${{ matrix.gcc }} + libxml2: "LOCAL" + libyuv: ${{ matrix.libyuv }} + - uses: ./.github/actions/setup-macos + if: runner.os == 'macOS' + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON - -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL - -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL - -DAVIF_LIBYUV=${{ matrix.libyuv }} - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON - -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON - -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON - -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON - -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON + -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL + -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL + -DAVIF_LIBYUV=${{ matrix.libyuv }} + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON + -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON + -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON + -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON + -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure diff --git a/.github/workflows/ci-unix-static-av2.yml b/.github/workflows/ci-unix-static-av2.yml index a8453916ca..df22e7ed60 100644 --- a/.github/workflows/ci-unix-static-av2.yml +++ b/.github/workflows/ci-unix-static-av2.yml @@ -3,10 +3,10 @@ on: push: pull_request: paths: - - '.github/workflows/ci-unix-static-av2.yml' - - '**CMakeLists.txt' - - 'cmake/**' - - 'ext/**' + - ".github/workflows/ci-unix-static-av2.yml" + - "**CMakeLists.txt" + - "cmake/**" + - "ext/**" permissions: contents: read @@ -29,39 +29,39 @@ jobs: gcc: 14 steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - with: - codec-aom: 'LOCAL' - codec-dav1d: ${{ matrix.also-enable-av1-codecs }} - codec-rav1e: ${{ matrix.also-enable-av1-codecs }} - extra-cache-key: ${{ matrix.also-enable-av1-codecs }} - gcc-version: ${{ matrix.gcc }} - libyuv: 'LOCAL' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + with: + codec-aom: "LOCAL" + codec-dav1d: ${{ matrix.also-enable-av1-codecs }} + codec-rav1e: ${{ matrix.also-enable-av1-codecs }} + extra-cache-key: ${{ matrix.also-enable-av1-codecs }} + gcc-version: ${{ matrix.gcc }} + libyuv: "LOCAL" - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AVM=LOCAL - -DAVIF_CODEC_DAV1D=${{ matrix.also-enable-av1-codecs }} - -DAVIF_CODEC_RAV1E=${{ matrix.also-enable-av1-codecs }} - -DAVIF_CODEC_SVT=${{ matrix.also-enable-av1-codecs }} - -DAVIF_LIBYUV=LOCAL - -DAVIF_LIBSHARPYUV=LOCAL - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure - - name: Check static link bundling - run: | - cc -o avifenc -I./apps/shared -I./third_party/iccjpeg -I./include apps/avifenc.c \ - apps/shared/*.c third_party/iccjpeg/iccjpeg.c build/libavif.a \ - -lpng -ljpeg -lz -lm -ldl -lstdc++ + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AVM=LOCAL + -DAVIF_CODEC_DAV1D=${{ matrix.also-enable-av1-codecs }} + -DAVIF_CODEC_RAV1E=${{ matrix.also-enable-av1-codecs }} + -DAVIF_CODEC_SVT=${{ matrix.also-enable-av1-codecs }} + -DAVIF_LIBYUV=LOCAL + -DAVIF_LIBSHARPYUV=LOCAL + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure + - name: Check static link bundling + run: | + cc -o avifenc -I./apps/shared -I./third_party/iccjpeg -I./include apps/avifenc.c \ + apps/shared/*.c third_party/iccjpeg/iccjpeg.c build/libavif.a \ + -lpng -ljpeg -lz -lm -ldl -lstdc++ - ./avifenc --help + ./avifenc --help diff --git a/.github/workflows/ci-unix-static-sanitized.yml b/.github/workflows/ci-unix-static-sanitized.yml index 572869a499..2a73f8e176 100644 --- a/.github/workflows/ci-unix-static-sanitized.yml +++ b/.github/workflows/ci-unix-static-sanitized.yml @@ -3,10 +3,10 @@ on: push: pull_request: paths: - - '.github/workflows/ci-unix-static-sanitized.yml' - - '**CMakeLists.txt' - - 'cmake/**' - - 'ext/**' + - ".github/workflows/ci-unix-static-sanitized.yml" + - "**CMakeLists.txt" + - "cmake/**" + - "ext/**" permissions: contents: read @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - sanitizer: [ address, thread, undefined ] # TODO(yguyon): Add memory + sanitizer: [address, thread, undefined] # TODO(yguyon): Add memory env: CC: clang @@ -30,16 +30,16 @@ jobs: if: runner.os == 'Linux' id: setup_linux with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - libyuv: 'LOCAL' + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + libyuv: "LOCAL" extra-cache-key: ${{ matrix.sanitizer }} - uses: ./.github/actions/setup-macos if: runner.os == 'macOS' id: setup_macos with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" extra-cache-key: ${{ matrix.sanitizer }} - id: cache-hit run: echo "hit=${{ (runner.os == 'Linux' && steps.setup_linux.outputs.ext-cache-hit == 'true') || (runner.os == 'macOS' && steps.setup_macos.outputs.ext-cache-hit == 'true') }}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/ci-unix-static.yml b/.github/workflows/ci-unix-static.yml index 037fa0cc25..3c3618e006 100644 --- a/.github/workflows/ci-unix-static.yml +++ b/.github/workflows/ci-unix-static.yml @@ -3,10 +3,10 @@ on: push: pull_request: paths: - - '.github/workflows/ci-unix-static.yml' - - '**CMakeLists.txt' - - 'cmake/**' - - 'ext/**' + - ".github/workflows/ci-unix-static.yml" + - "**CMakeLists.txt" + - "cmake/**" + - "ext/**" permissions: contents: read @@ -30,49 +30,49 @@ jobs: gcc: 14 steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-linux - if: runner.os == 'Linux' - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - codec-rav1e: 'LOCAL' - gcc-version: ${{ matrix.gcc }} - libxml2: 'LOCAL' - libyuv: 'LOCAL' - - uses: ./.github/actions/setup-macos - if: runner.os == 'macOS' - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - codec-rav1e: 'LOCAL' - extra-cache-key: ${{ matrix.build-type }} + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-linux + if: runner.os == 'Linux' + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + codec-rav1e: "LOCAL" + gcc-version: ${{ matrix.gcc }} + libxml2: "LOCAL" + libyuv: "LOCAL" + - uses: ./.github/actions/setup-macos + if: runner.os == 'macOS' + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + codec-rav1e: "LOCAL" + extra-cache-key: ${{ matrix.build-type }} - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL - -DAVIF_CODEC_RAV1E=LOCAL -DAVIF_CODEC_SVT=LOCAL - -DAVIF_CODEC_LIBGAV1=LOCAL - -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL -DAVIF_LIBYUV=LOCAL - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON - -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON - -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON - -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON - -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure - - name: Check static link bundling - run: | - cc -o avifenc -I./apps/shared -I./third_party/iccjpeg -I./include apps/avifenc.c \ - apps/shared/*.c third_party/iccjpeg/iccjpeg.c build/libavif.a \ - -lpng -ljpeg -lz -lm -ldl -lstdc++ + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL + -DAVIF_CODEC_RAV1E=LOCAL -DAVIF_CODEC_SVT=LOCAL + -DAVIF_CODEC_LIBGAV1=LOCAL + -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL -DAVIF_LIBYUV=LOCAL + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON + -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON + -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON + -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON + -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure + - name: Check static link bundling + run: | + cc -o avifenc -I./apps/shared -I./third_party/iccjpeg -I./include apps/avifenc.c \ + apps/shared/*.c third_party/iccjpeg/iccjpeg.c build/libavif.a \ + -lpng -ljpeg -lz -lm -ldl -lstdc++ - ./avifenc --help + ./avifenc --help diff --git a/.github/workflows/ci-windows-artifacts.yml b/.github/workflows/ci-windows-artifacts.yml index 3bdc17e5c9..4496dabee0 100644 --- a/.github/workflows/ci-windows-artifacts.yml +++ b/.github/workflows/ci-windows-artifacts.yml @@ -17,73 +17,73 @@ jobs: os: [windows-latest] steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-windows - id: setup - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-windows + id: setup + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" - - name: Build aom - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: ./aom.cmd - - name: Build dav1d - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: ./dav1d.cmd - - name: Build libyuv - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: ./libyuv.cmd - # Use clang-cl to build libyuv. The assembly code in libyuv is written in the - # GCC inline assembly format. Visual C++ doesn't support GCC inline assembly. - env: - CC: clang-cl - CXX: clang-cl - - name: Build libsharpyuv - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: ./libsharpyuv.cmd - - name: Build libjpeg - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: ./libjpeg.cmd - - name: Build zlib and libpng - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: ./zlibpng.cmd + - name: Build aom + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: ./aom.cmd + - name: Build dav1d + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: ./dav1d.cmd + - name: Build libyuv + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: ./libyuv.cmd + # Use clang-cl to build libyuv. The assembly code in libyuv is written in the + # GCC inline assembly format. Visual C++ doesn't support GCC inline assembly. + env: + CC: clang-cl + CXX: clang-cl + - name: Build libsharpyuv + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: ./libsharpyuv.cmd + - name: Build libjpeg + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: ./libjpeg.cmd + - name: Build zlib and libpng + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: ./zlibpng.cmd - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_AOM_ENCODE=ON - -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_DAV1D=LOCAL - -DAVIF_LIBYUV=LOCAL -DAVIF_LIBSHARPYUV=LOCAL - -DAVIF_JPEG=LOCAL -DAVIF_ZLIBPNG=LOCAL - -DAVIF_BUILD_EXAMPLES=OFF -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=OFF -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Archive artifacts - uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # 0.7.6 - with: - type: 'zip' - filename: 'windows-artifacts.zip' - directory: 'build' - path: '*.exe' - - name: Upload artifacts - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # See https://docs.github.com/en/webhooks/webhook-events-and-payloads#release. - upload_url: ${{ github.event.release.upload_url }} - asset_path: build/windows-artifacts.zip - asset_name: windows-artifacts.zip - asset_content_type: application/zip + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_AOM_ENCODE=ON + -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_DAV1D=LOCAL + -DAVIF_LIBYUV=LOCAL -DAVIF_LIBSHARPYUV=LOCAL + -DAVIF_JPEG=LOCAL -DAVIF_ZLIBPNG=LOCAL + -DAVIF_BUILD_EXAMPLES=OFF -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=OFF -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Archive artifacts + uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # 0.7.6 + with: + type: "zip" + filename: "windows-artifacts.zip" + directory: "build" + path: "*.exe" + - name: Upload artifacts + uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # See https://docs.github.com/en/webhooks/webhook-events-and-payloads#release. + upload_url: ${{ github.event.release.upload_url }} + asset_path: build/windows-artifacts.zip + asset_name: windows-artifacts.zip + asset_content_type: application/zip # Use the following instead of the above to test this workflow outside of a release event. # - name: Upload artifacts diff --git a/.github/workflows/ci-windows-installed.yml b/.github/workflows/ci-windows-installed.yml index f3a9b9a098..3dd54e0e13 100644 --- a/.github/workflows/ci-windows-installed.yml +++ b/.github/workflows/ci-windows-installed.yml @@ -24,63 +24,63 @@ jobs: compiler: [msvc, clang-cl] steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-windows - with: - codec-aom: 'SYSTEM' - codec-dav1d: 'SYSTEM' - codec-rav1e: 'SYSTEM' - extra-cache-key: ${{ matrix.compiler }} - - name: Leave compiler as default - if: matrix.compiler == 'msvc' - run: | - echo "AVIF_CMAKE_C_COMPILER=" >> $env:GITHUB_ENV - echo "AVIF_CMAKE_CXX_COMPILER=" >> $env:GITHUB_ENV - - name: Set clang-cl as compiler - if: matrix.compiler == 'clang-cl' - run: | - echo "AVIF_CMAKE_C_COMPILER=-DCMAKE_C_COMPILER=clang-cl" >> $env:GITHUB_ENV - echo "AVIF_CMAKE_CXX_COMPILER=-DCMAKE_CXX_COMPILER=clang-cl" >> $env:GITHUB_ENV + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-windows + with: + codec-aom: "SYSTEM" + codec-dav1d: "SYSTEM" + codec-rav1e: "SYSTEM" + extra-cache-key: ${{ matrix.compiler }} + - name: Leave compiler as default + if: matrix.compiler == 'msvc' + run: | + echo "AVIF_CMAKE_C_COMPILER=" >> $env:GITHUB_ENV + echo "AVIF_CMAKE_CXX_COMPILER=" >> $env:GITHUB_ENV + - name: Set clang-cl as compiler + if: matrix.compiler == 'clang-cl' + run: | + echo "AVIF_CMAKE_C_COMPILER=-DCMAKE_C_COMPILER=clang-cl" >> $env:GITHUB_ENV + echo "AVIF_CMAKE_CXX_COMPILER=-DCMAKE_CXX_COMPILER=clang-cl" >> $env:GITHUB_ENV - - name: vcpkg build - uses: johnwason/vcpkg-action@v6 - id: vcpkg - with: - pkgs: aom dav1d libjpeg-turbo libpng libxml2 libyuv zlib - triplet: x64-windows-release - token: ${{ github.token }} - github-binarycache: true - cache-key: ${{ hashFiles('cmake/Modules/*', 'ext/*.cmd', 'ext/*.sh') }} - - name: Install rav1e - run: | - $LINK = "https://github.com/xiph/rav1e/releases/download/v0.7.1" - $FILE = "rav1e-0.7.1-windows-msvc-generic" - curl -LO "$LINK/$FILE.zip" - mkdir -p ${{ github.workspace }}\tmp - 7z x -y "$FILE.zip" -o"${{ github.workspace }}\tmp" - # Do not mv the folder's content to not overwrite, and rsync is not installed. - mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\bin\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\bin - mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\include\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\include - mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\lib\rav1e* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\lib - mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\lib\pkgconfig\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\lib\pkgconfig - - name: Prepare libavif (cmake) - run: > - cmake ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AOM=SYSTEM -DAVIF_CODEC_DAV1D=SYSTEM - -DAVIF_CODEC_RAV1E=SYSTEM - -DAVIF_JPEG=SYSTEM -DAVIF_LIBXML2=SYSTEM - -DAVIF_LIBYUV=SYSTEM -DAVIF_ZLIBPNG=SYSTEM - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON - -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON - -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON - -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON - -DAVIF_ENABLE_WERROR=ON $env:AVIF_CMAKE_C_COMPILER $env:AVIF_CMAKE_CXX_COMPILER - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $Env:NUMBER_OF_PROCESSORS --output-on-failure + - name: vcpkg build + uses: johnwason/vcpkg-action@v6 + id: vcpkg + with: + pkgs: aom dav1d libjpeg-turbo libpng libxml2 libyuv zlib + triplet: x64-windows-release + token: ${{ github.token }} + github-binarycache: true + cache-key: ${{ hashFiles('cmake/Modules/*', 'ext/*.cmd', 'ext/*.sh') }} + - name: Install rav1e + run: | + $LINK = "https://github.com/xiph/rav1e/releases/download/v0.7.1" + $FILE = "rav1e-0.7.1-windows-msvc-generic" + curl -LO "$LINK/$FILE.zip" + mkdir -p ${{ github.workspace }}\tmp + 7z x -y "$FILE.zip" -o"${{ github.workspace }}\tmp" + # Do not mv the folder's content to not overwrite, and rsync is not installed. + mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\bin\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\bin + mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\include\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\include + mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\lib\rav1e* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\lib + mv ${{ github.workspace }}\tmp\rav1e-windows-msvc-sdk\lib\pkgconfig\* ${{ github.workspace }}\vcpkg\installed\x64-windows-release\lib\pkgconfig + - name: Prepare libavif (cmake) + run: > + cmake ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AOM=SYSTEM -DAVIF_CODEC_DAV1D=SYSTEM + -DAVIF_CODEC_RAV1E=SYSTEM + -DAVIF_JPEG=SYSTEM -DAVIF_LIBXML2=SYSTEM + -DAVIF_LIBYUV=SYSTEM -DAVIF_ZLIBPNG=SYSTEM + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON + -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON + -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON + -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON + -DAVIF_ENABLE_WERROR=ON $env:AVIF_CMAKE_C_COMPILER $env:AVIF_CMAKE_CXX_COMPILER + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $Env:NUMBER_OF_PROCESSORS --output-on-failure diff --git a/.github/workflows/ci-windows-shared-local.yml b/.github/workflows/ci-windows-shared-local.yml index f7c6ea3eeb..fd60da59ad 100644 --- a/.github/workflows/ci-windows-shared-local.yml +++ b/.github/workflows/ci-windows-shared-local.yml @@ -5,10 +5,10 @@ on: push: pull_request: paths: - - '.github/workflows/ci-windows-shared-local.yml' - - '**CMakeLists.txt' - - 'cmake/**' - - 'ext/**' + - ".github/workflows/ci-windows-shared-local.yml" + - "**CMakeLists.txt" + - "cmake/**" + - "ext/**" permissions: contents: read @@ -27,40 +27,40 @@ jobs: compiler: [msvc, clang-cl] steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-windows - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - extra-cache-key: ${{ matrix.compiler }} - - name: Leave compiler as default - if: matrix.compiler == 'msvc' - run: | - echo "AVIF_CMAKE_C_COMPILER=" >> $env:GITHUB_ENV - echo "AVIF_CMAKE_CXX_COMPILER=" >> $env:GITHUB_ENV - - name: Set clang-cl as compiler - if: matrix.compiler == 'clang-cl' - run: | - echo "AVIF_CMAKE_C_COMPILER=-DCMAKE_C_COMPILER=clang-cl" >> $env:GITHUB_ENV - echo "AVIF_CMAKE_CXX_COMPILER=-DCMAKE_CXX_COMPILER=clang-cl" >> $env:GITHUB_ENV + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-windows + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + extra-cache-key: ${{ matrix.compiler }} + - name: Leave compiler as default + if: matrix.compiler == 'msvc' + run: | + echo "AVIF_CMAKE_C_COMPILER=" >> $env:GITHUB_ENV + echo "AVIF_CMAKE_CXX_COMPILER=" >> $env:GITHUB_ENV + - name: Set clang-cl as compiler + if: matrix.compiler == 'clang-cl' + run: | + echo "AVIF_CMAKE_C_COMPILER=-DCMAKE_C_COMPILER=clang-cl" >> $env:GITHUB_ENV + echo "AVIF_CMAKE_CXX_COMPILER=-DCMAKE_CXX_COMPILER=clang-cl" >> $env:GITHUB_ENV - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON - -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL - -DAVIF_JPEG=LOCAL -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL - -DAVIF_LIBYUV=LOCAL -DAVIF_ZLIBPNG=LOCAL - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON - -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON - -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON - -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON - -DAVIF_ENABLE_WERROR=ON $env:AVIF_CMAKE_C_COMPILER $env:AVIF_CMAKE_CXX_COMPILER - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $Env:NUMBER_OF_PROCESSORS --output-on-failure + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON + -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL + -DAVIF_JPEG=LOCAL -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL + -DAVIF_LIBYUV=LOCAL -DAVIF_ZLIBPNG=LOCAL + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON + -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON + -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON + -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON + -DAVIF_ENABLE_WERROR=ON $env:AVIF_CMAKE_C_COMPILER $env:AVIF_CMAKE_CXX_COMPILER + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $Env:NUMBER_OF_PROCESSORS --output-on-failure diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index fc360067e0..ea307c4086 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -15,10 +15,10 @@ on: push: pull_request: paths: - - '.github/workflows/ci-windows.yml' - - '**CMakeLists.txt' - - 'cmake/**' - - 'ext/**' + - ".github/workflows/ci-windows.yml" + - "**CMakeLists.txt" + - "cmake/**" + - "ext/**" permissions: contents: read @@ -37,64 +37,64 @@ jobs: os: [windows-latest] steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: ./.github/actions/setup-windows - id: setup - with: - codec-aom: 'LOCAL' - codec-dav1d: 'LOCAL' - codec-rav1e: 'LOCAL' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: ./.github/actions/setup-windows + id: setup + with: + codec-aom: "LOCAL" + codec-dav1d: "LOCAL" + codec-rav1e: "LOCAL" - - name: Build libyuv - if: steps.setup.outputs.ext-cache-hit != 'true' - working-directory: ./ext - run: ./libyuv.cmd - # Use clang-cl to build libyuv. The assembly code in libyuv is written in the - # GCC inline assembly format. Visual C++ doesn't support GCC inline assembly. - env: - CC: clang-cl - CXX: clang-cl + - name: Build libyuv + if: steps.setup.outputs.ext-cache-hit != 'true' + working-directory: ./ext + run: ./libyuv.cmd + # Use clang-cl to build libyuv. The assembly code in libyuv is written in the + # GCC inline assembly format. Visual C++ doesn't support GCC inline assembly. + env: + CC: clang-cl + CXX: clang-cl - - name: Prepare libavif (cmake) - run: > - cmake -G Ninja -S . -B build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL - -DAVIF_CODEC_RAV1E=LOCAL -DAVIF_CODEC_SVT=LOCAL - -DAVIF_CODEC_LIBGAV1=LOCAL - -DAVIF_JPEG=LOCAL -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL - -DAVIF_LIBYUV=LOCAL -DAVIF_ZLIBPNG=LOCAL - -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON - -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL - -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON - -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON - -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON - -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON - -DAVIF_ENABLE_WERROR=ON - - name: Build libavif (ninja) - working-directory: ./build - run: ninja - - name: Run AVIF Tests - working-directory: ./build - run: ctest -j $Env:NUMBER_OF_PROCESSORS --output-on-failure - - name: Check static link bundling - run: > - cl .\apps\avifenc.c .\apps\shared\*.c .\third_party\iccjpeg\iccjpeg.c /nologo - /DWIN32 /D_WINDOWS /MD /O2 /Ob2 - -I.\apps\shared -I.\include -I.\third_party\iccjpeg - -external:W0 - -external:I.\build\_deps\libpng-src - -external:I.\build\libjpeg\src\libjpeg - -external:I.\build\libjpeg\src\libjpeg-build - -external:I.\build\_deps\zlib-src - -external:I.\build\_deps\libpng - -external:I.\build\_deps\zlib - /link - build\libjpeg\src\libjpeg-build\jpeg-static.lib - build\_deps\libpng\libpng16_static.lib - build\_deps\zlib\zlibstatic.lib - build\avif.lib - ws2_32.lib ntdll.lib userenv.lib bcrypt.lib advapi32.lib - /out:avifenc.exe + - name: Prepare libavif (cmake) + run: > + cmake -G Ninja -S . -B build + -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL + -DAVIF_CODEC_RAV1E=LOCAL -DAVIF_CODEC_SVT=LOCAL + -DAVIF_CODEC_LIBGAV1=LOCAL + -DAVIF_JPEG=LOCAL -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBXML2=LOCAL + -DAVIF_LIBYUV=LOCAL -DAVIF_ZLIBPNG=LOCAL + -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON + -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL + -DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON + -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON + -DAVIF_ENABLE_EXPERIMENTAL_MINI=ON + -DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON + -DAVIF_ENABLE_WERROR=ON + - name: Build libavif (ninja) + working-directory: ./build + run: ninja + - name: Run AVIF Tests + working-directory: ./build + run: ctest -j $Env:NUMBER_OF_PROCESSORS --output-on-failure + - name: Check static link bundling + run: > + cl .\apps\avifenc.c .\apps\shared\*.c .\third_party\iccjpeg\iccjpeg.c /nologo + /DWIN32 /D_WINDOWS /MD /O2 /Ob2 + -I.\apps\shared -I.\include -I.\third_party\iccjpeg + -external:W0 + -external:I.\build\_deps\libpng-src + -external:I.\build\libjpeg\src\libjpeg + -external:I.\build\libjpeg\src\libjpeg-build + -external:I.\build\_deps\zlib-src + -external:I.\build\_deps\libpng + -external:I.\build\_deps\zlib + /link + build\libjpeg\src\libjpeg-build\jpeg-static.lib + build\_deps\libpng\libpng16_static.lib + build\_deps\zlib\zlibstatic.lib + build\avif.lib + ws2_32.lib ntdll.lib userenv.lib bcrypt.lib advapi32.lib + /out:avifenc.exe - .\avifenc.exe --help + .\avifenc.exe --help diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 2a35a9a88e..892fca21df 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -10,9 +10,9 @@ on: # To guarantee Maintained check is occasionally updated. See # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained schedule: - - cron: '37 5 * * 3' + - cron: "37 5 * * 3" push: - branches: [ "main" ] + branches: ["main"] # Declare default permissions as read only. permissions: read-all