Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use composite actions #2166

Merged
merged 3 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/actions/setup-common/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Common setup for all OSes'
description: 'Installs common dependencies'
inputs:
codec-aom:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-dav1d:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-rav1e:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
recent-cmake:
description: 'Can take the values: true, false. Only useful on Linux'
default: 'false'
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.x'
- name: Set up CMake < 3.18
if: ${{ runner.os == 'Linux' && inputs.recent-cmake == 'false' }}
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
with:
cmake-version: '3.13.x'
- name: Set up CMake >= 3.18
if: ${{ runner.os == 'Linux' && inputs.recent-cmake == 'true' }}
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
with:
cmake-version: '3.18.x'
- name: Print CMake version
run: cmake --version
shell: bash
vrabaud marked this conversation as resolved.
Show resolved Hide resolved
- name: Set up ninja
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
- name: Set up nasm
if: ${{ inputs.codec-aom == 'LOCAL' || inputs.codec-dav1d == 'LOCAL' }}
uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1
- name: Set up meson
if: ${{ inputs.codec-dav1d == 'LOCAL' }}
run: pip install meson
shell: bash
- name: Set up rust
if: ${{ inputs.codec-rav1e == 'LOCAL' }}
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true
80 changes: 80 additions & 0 deletions .github/actions/setup-linux/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
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'
codec-dav1d:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
edfault: 'OFF'
codec-rav1e:
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: ''
gcc-version:
description: 'Can be empty, in which case CC and CXX are not overriden'
default: ''
libxml2:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
libyuv:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
vrabaud marked this conversation as resolved.
Show resolved Hide resolved
recent-cmake:
description: 'Can take the values: true, false'
default: 'false'
outputs:
ext-cache-hit:
value: ${{ steps.cache.outputs.ext-cache-hit }}
runs:
using: "composite"
steps:
- name: Install non-library dependencies
run: |
sudo apt update
sudo apt install imagemagick libjpeg-turbo8-dev libpng-dev
shell: bash
- name: Install libaom library
if: ${{ inputs.codec-aom == 'SYSTEM' }}
run:
sudo apt install libaom-dev
shell: bash
- name: Install libdav1d library
if: ${{ inputs.codec-dav1d == 'SYSTEM' }}
run:
sudo apt install libdav1d-dev
shell: bash
- name: Install rav1e library
if: ${{ inputs.codec-rav1e == 'SYSTEM' }}
run:
sudo apt install librav1e-dev
shell: bash
- name: Install libxml2 library
if: ${{ inputs.libxml2 == 'SYSTEM' }}
run:
sudo apt install libxml2
shell: bash
- name: Install libyuv library
if: ${{ inputs.libyuv == 'SYSTEM' }}
run:
sudo apt install libyuv-dev
shell: bash

- uses: ./.github/actions/setup-common
with:
codec-aom: ${{ inputs.codec-aom }}
codec-dav1d: ${{ inputs.codec-dav1d }}
codec-rav1e: ${{ inputs.codec-rav1e }}
recent-cmake: ${{ inputs.recent-cmake }}
- uses: ./.github/actions/cache
id: cache
with:
extra-key: ${{ inputs.extra-cache-key }}
use-rust: ${{ inputs.codec-rav1e == 'LOCAL' }}

- name: Set GCC & G++ compiler
if: ${{ inputs.gcc-version != '' }}
run: echo "CC=gcc-${{ inputs.gcc-version }}" >> $GITHUB_ENV && echo "CXX=g++-${{ inputs.gcc-version }}" >> $GITHUB_ENV
shell: bash
vrabaud marked this conversation as resolved.
Show resolved Hide resolved
43 changes: 43 additions & 0 deletions .github/actions/setup-macos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Setup on macOS'
description: 'Installs dependencies specific to macOS'
inputs:
codec-aom:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-dav1d:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-rav1e:
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: ''
outputs:
ext-cache-hit:
value: ${{ steps.cache.outputs.ext-cache-hit }}
runs:
using: "composite"
steps:
- name: Install non-library dependencies
run: brew install imagemagick
vrabaud marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
- name: Install AOM library
if: ${{ inputs.codec-aom == 'SYSTEM' }}
run: brew install aom
shell: bash
- name: Install dav1d library
if: ${{ inputs.codec-dav1d == 'SYSTEM' }}
run: brew install dav1d
shell: bash

- uses: ./.github/actions/setup-common
with:
codec-aom: ${{ inputs.codec-aom }}
codec-dav1d: ${{ inputs.codec-dav1d }}
codec-rav1e: ${{ inputs.codec-rav1e }}
- uses: ./.github/actions/cache
id: cache
with:
extra-key: ${{ inputs.extra-cache-key }}
use-rust: ${{ inputs.codec-rav1e == 'LOCAL' }}
34 changes: 34 additions & 0 deletions .github/actions/setup-windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Setup on Windows'
description: 'Installs dependencies specific to Windows'
inputs:
codec-aom:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-dav1d:
description: 'Can take the values: OFF, LOCAL, SYSTEM'
default: 'OFF'
codec-rav1e:
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: ''
outputs:
ext-cache-hit:
value: ${{ steps.cache.outputs.ext-cache-hit }}
runs:
using: "composite"
steps:
- name: Setup Visual Studio shell
uses: egor-tensin/vs-shell@9a932a62d05192eae18ca370155cf877eecc2202 # v2.1

- uses: ./.github/actions/setup-common
with:
codec-aom: ${{ inputs.codec-aom }}
codec-dav1d: ${{ inputs.codec-dav1d }}
codec-rav1e: ${{ inputs.codec-rav1e }}
- uses: ./.github/actions/cache
id: cache
with:
extra-key: ${{ inputs.extra-cache-key }}
use-rust: ${{ inputs.codec-rav1e == 'LOCAL' }}
17 changes: 4 additions & 13 deletions .github/workflows/ci-android-emulator-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,11 @@ jobs:
# r25c is the same as 25.2.9519653.
ndk-version: r25c
add-to-path: false
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
- uses: ./.github/actions/setup-common
with:
cmake-version: "3.19.x"
- name: Setup python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.x'
- name: Setup meson
run: pip install meson
- name: Setup nasm
uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1
codec-aom: 'LOCAL'
codec-dav1d: 'LOCAL'
recent-cmake: 'true'
- name: Setup JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/ci-android-jni.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,11 @@ jobs:
# r25c is the same as 25.2.9519653.
ndk-version: r25c
add-to-path: false
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
- uses: ./.github/actions/setup-common
with:
cmake-version: "3.19.x"
- name: Setup python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.x'
- name: Setup meson
run: pip install meson
- name: Setup nasm
uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1
codec-aom: 'LOCAL'
codec-dav1d: 'LOCAL'
recent-cmake: 'true'
- name: Setup JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
Expand Down
34 changes: 7 additions & 27 deletions .github/workflows/ci-disable-gtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,14 @@ jobs:

steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set GCC & G++ compiler (on Linux)
if: runner.os == 'Linux'
run: echo "CC=gcc-${{matrix.gcc}}" >> $GITHUB_ENV && echo "CXX=g++-${{matrix.gcc}}" >> $GITHUB_ENV
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
- uses: ./.github/actions/setup-linux
with:
python-version: '3.x'
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true
- name: Install dependencies
run: |
sudo apt update
sudo apt install imagemagick libjpeg-turbo8-dev libpng-dev
- uses: ./.github/actions/cache
with:
use-rust: true
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
with:
# CMake version 3.17 is required to build libwebp (which libsharpyuv is part of) on macOS.
cmake-version: '3.17.x'
- name: Print cmake version
run: cmake --version
- uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1
- uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
- run: pip install meson
codec-aom: 'LOCAL'
codec-dav1d: 'LOCAL'
codec-rav1e: 'LOCAL'
gcc-version: ${{ matrix.gcc }}
libyuv: 'LOCAL'
recent-cmake: 'true'

- name: Prepare libavif (cmake)
run: >
Expand Down
29 changes: 9 additions & 20 deletions .github/workflows/ci-linux-golden-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,17 @@ jobs:

steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- 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@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
- uses: ./.github/actions/setup-linux
id: setup
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt update
sudo apt install imagemagick libjpeg-turbo8-dev libpng-dev
- uses: ./.github/actions/cache
id: cache
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be
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
- uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
codec-aom: 'LOCAL'
codec-dav1d: 'LOCAL'
gcc-version: ${{ matrix.gcc }}
libxml2: 'LOCAL'
libyuv: 'LOCAL'
recent-cmake: 'true'
- name: Build mp4box
if: steps.cache.outputs.ext-cache-hit != 'true'
if: steps.setup.outputs.ext-cache-hit != 'true'
working-directory: ./ext
run: bash -e mp4box.sh

Expand Down
36 changes: 8 additions & 28 deletions .github/workflows/ci-linux-static-old-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,15 @@ jobs:

steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- 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@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
- uses: ./.github/actions/setup-linux
with:
python-version: '3.x'
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true
- name: Install dependencies (Linux)
run: |
sudo apt update
sudo apt install imagemagick libjpeg-turbo8-dev libpng-dev
- uses: ./.github/actions/cache
with:
use-rust: true
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
with:
# CMake version 3.18 is required to build libxml2.
cmake-version: '3.18.x'
- name: Print cmake version
run: cmake --version
- uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1
- uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
- run: pip install meson
- name: Print ImageMagick version
run: convert --version
codec-aom: 'LOCAL'
codec-dav1d: 'LOCAL'
codec-rav1e: 'LOCAL'
gcc-version: ${{ matrix.gcc }}
libxml2: 'LOCAL'
libyuv: 'LOCAL'
recent-cmake: 'true'
- name: Prepare libavif (cmake)
run: >
cmake .. -G Ninja -S . -B build
Expand Down
Loading
Loading