Skip to content

Commit 80feb2f

Browse files
authored
Unify installing packages in the CI (AOMediaCodec#3086)
Also: - test more OSes with installed rav1e and svt-av1 - clean rav1e needed libraries in CMake
1 parent a53108e commit 80feb2f

17 files changed

Lines changed: 132 additions & 57 deletions

.github/actions/setup-linux/action.yml

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
default: "OFF"
77
codec-dav1d:
88
description: "Can take the values: OFF, LOCAL, SYSTEM"
9-
edfault: "OFF"
9+
default: "OFF"
1010
codec-rav1e:
1111
description: "Can take the values: OFF, LOCAL, SYSTEM"
1212
default: "OFF"
@@ -22,6 +22,9 @@ inputs:
2222
gtest:
2323
description: "Can take the values: OFF, LOCAL, SYSTEM"
2424
default: "OFF"
25+
libjpeg-turbo:
26+
description: "Can take the values: OFF, LOCAL, SYSTEM"
27+
default: "OFF"
2528
libxml2:
2629
description: "Can take the values: OFF, LOCAL, SYSTEM"
2730
default: "OFF"
@@ -31,48 +34,64 @@ inputs:
3134
oldest-cmake:
3235
description: "Can take the values: true, false"
3336
default: "false"
37+
zlibpng:
38+
description: "Can take the values: OFF, LOCAL, SYSTEM"
39+
default: "OFF"
3440
outputs:
3541
ext-cache-hit:
3642
value: ${{ steps.cache.outputs.ext-cache-hit }}
3743
runs:
3844
using: "composite"
3945
steps:
40-
- name: Install non-library dependencies
41-
run: |
42-
sudo apt update -y
43-
sudo apt install -y imagemagick libjpeg-turbo8-dev libpng-dev
44-
shell: bash
4546
- name: Install libaom library
4647
if: ${{ inputs.codec-aom == 'SYSTEM' }}
47-
run: sudo apt install -y libaom-dev
48+
run: echo "AVIF_UNIX_LIBRARIES=libaom-dev" >> "$GITHUB_ENV"
49+
shell: bash
50+
- name: Set up meson
51+
if: ${{ inputs.codec-dav1d == 'LOCAL' }}
52+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} meson" >> "$GITHUB_ENV"
4853
shell: bash
4954
- name: Install libdav1d library
5055
if: ${{ inputs.codec-dav1d == 'SYSTEM' }}
51-
run: sudo apt install -y libdav1d-dev
56+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} libdav1d-dev" >> "$GITHUB_ENV"
5257
shell: bash
5358
- name: Install rav1e library
5459
if: ${{ inputs.codec-rav1e == 'SYSTEM' }}
55-
run: sudo apt install -y librav1e-dev
60+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} librav1e-dev" >> "$GITHUB_ENV"
5661
shell: bash
5762
- name: Install SVT-AV1 library
58-
if: ${{ inputs.codec-rav1e == 'SYSTEM' }}
59-
run: sudo apt install -y libsvtav1enc-dev
63+
if: ${{ inputs.codec-svt == 'SYSTEM' }}
64+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} libsvtav1enc-dev" >> "$GITHUB_ENV"
65+
shell: bash
66+
- name: Set up tests
67+
if: ${{ inputs.gtest != 'OFF' }}
68+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} imagemagick" >> "$GITHUB_ENV"
69+
shell: bash
70+
- name: Set up gtest
71+
if: ${{ inputs.gtest == 'SYSTEM' }}
72+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} libgtest-dev" >> "$GITHUB_ENV"
73+
shell: bash
74+
- name: Install libjpeg-turbo library
75+
if: ${{ inputs.libjpeg-turbo == 'SYSTEM' }}
76+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} libjpeg-turbo8-dev" >> "$GITHUB_ENV"
6077
shell: bash
6178
- name: Install libxml2 library
6279
if: ${{ inputs.libxml2 == 'SYSTEM' }}
63-
run: sudo apt install -y libxml2
80+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} libxml2" >> "$GITHUB_ENV"
6481
shell: bash
6582
- name: Install libyuv library
6683
if: ${{ inputs.libyuv == 'SYSTEM' }}
67-
run: sudo apt install -y libyuv-dev
84+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} libyuv-dev" >> "$GITHUB_ENV"
6885
shell: bash
69-
- name: Set up meson
70-
if: ${{ inputs.codec-dav1d == 'LOCAL' }}
71-
run: sudo apt install -y meson
86+
- name: Install zlibpng library
87+
if: ${{ inputs.zlibpng == 'SYSTEM' }}
88+
run: echo "AVIF_UNIX_LIBRARIES=${{ env.AVIF_UNIX_LIBRARIES }} libpng-dev" >> "$GITHUB_ENV"
7289
shell: bash
73-
- name: Set up gtest
74-
if: ${{ inputs.gtest == 'SYSTEM' }}
75-
run: sudo apt install -y libgtest-dev
90+
91+
- name: Install libraries
92+
run: |
93+
sudo apt update -y
94+
sudo apt install -y ${{ env.AVIF_UNIX_LIBRARIES }}
7695
shell: bash
7796

7897
- uses: ./.github/actions/cache

.github/actions/setup-macos/action.yml

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,76 @@ inputs:
1313
codec-svt:
1414
description: "Can take the values: OFF, LOCAL, SYSTEM"
1515
default: "OFF"
16-
gtest:
17-
description: "Can take the values: OFF, LOCAL, SYSTEM"
18-
default: "OFF"
1916
extra-cache-key:
2017
description: "Extra cache key to use in the cache name. Useful when several caches are used in one workflow."
2118
default: ""
19+
gtest:
20+
description: "Can take the values: OFF, LOCAL, SYSTEM"
21+
default: "OFF"
22+
libjpeg-turbo:
23+
description: "Can take the values: OFF, LOCAL, SYSTEM"
24+
default: "OFF"
25+
libxml2:
26+
description: "Can take the values: OFF, LOCAL, SYSTEM"
27+
default: "OFF"
28+
zlibpng:
29+
description: "Can take the values: OFF, LOCAL, SYSTEM"
30+
default: "OFF"
2231
outputs:
2332
ext-cache-hit:
2433
value: ${{ steps.cache.outputs.ext-cache-hit }}
2534
runs:
2635
using: "composite"
2736
steps:
28-
- name: Force update all brew python
29-
run: |
30-
brew update
31-
# GHA messes with links https://github.com/actions/setup-python/issues/577 so we just force replace their installs' with brew's
32-
for pkg in $(brew list --formula | grep -E '^python(@[0-9]+\.[0-9]+)?$'); do
33-
brew upgrade --force --overwrite "$pkg"
34-
done
35-
brew cleanup
36-
shell: bash
37-
- name: Install non-library test dependencies
38-
# imagemagick is used in sh tests (not gtest tests) but we assume that no tests are run by the CI
39-
# if gtest is off
40-
if: ${{ inputs.gtest != 'OFF' }}
41-
run: brew install imagemagick
42-
shell: bash
4337
- name: Install AOM library
4438
if: ${{ inputs.codec-aom == 'SYSTEM' }}
45-
run: brew install aom
39+
run: echo "AVIF_MAC_LIBRARIES=aom" >> "$GITHUB_ENV"
4640
shell: bash
4741
- name: Install dav1d library
4842
if: ${{ inputs.codec-dav1d == 'SYSTEM' }}
49-
run: brew install dav1d
43+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} dav1d" >> "$GITHUB_ENV"
44+
shell: bash
45+
- name: Install rav1e library
46+
if: ${{ inputs.codec-rav1e == 'SYSTEM' }}
47+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} rav1e" >> "$GITHUB_ENV"
48+
shell: bash
49+
- name: Install SVT-AV1 library
50+
if: ${{ inputs.codec-svt == 'SYSTEM' }}
51+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} svt-av1" >> "$GITHUB_ENV"
5052
shell: bash
5153
- name: Set up meson
5254
if: ${{ inputs.codec-dav1d == 'LOCAL' }}
53-
run: brew install meson
55+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} meson" >> "$GITHUB_ENV"
5456
shell: bash
5557
- name: Set up gtest
58+
# imagemagick is used in sh tests (not gtest tests) but we assume that no tests are run by the CI
59+
# if gtest is off
60+
if: ${{ inputs.gtest != 'OFF' }}
61+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} imagemagick" >> "$GITHUB_ENV"
62+
shell: bash
63+
- name: Set up tests
5664
if: ${{ inputs.gtest == 'SYSTEM' }}
57-
run: brew install googletest
65+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} googletest" >> "$GITHUB_ENV"
66+
shell: bash
67+
- name: Set up libjpeg-turbo
68+
if: ${{ inputs.libjpeg-turbo == 'SYSTEM' }}
69+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} libjpeg-turbo" >> "$GITHUB_ENV"
70+
shell: bash
71+
- name: Set up libxml2
72+
if: ${{ inputs.libxml2 == 'SYSTEM' }}
73+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} libxml2" >> "$GITHUB_ENV"
74+
shell: bash
75+
- name: Set up zlibpng
76+
if: ${{ inputs.zlibpng == 'SYSTEM' }}
77+
run: echo "AVIF_MAC_LIBRARIES=${{ env.AVIF_MAC_LIBRARIES }} libpng" >> "$GITHUB_ENV"
78+
shell: bash
79+
80+
- name: Install libraries
81+
if: env.AVIF_MAC_LIBRARIES != ''
82+
run: |
83+
brew update
84+
brew cleanup
85+
brew install ${{ env.AVIF_MAC_LIBRARIES }}
5886
shell: bash
5987

6088
- uses: ./.github/actions/cache

.github/actions/setup-windows/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ runs:
4545

4646
- name: Install libaom library
4747
if: ${{ inputs.codec-aom == 'SYSTEM' }}
48-
run: echo "AVIF_WIN_LIBRARIES=${{ env.AVIF_WIN_LIBRARIES }} aom" >> "$GITHUB_ENV"
48+
run: echo "AVIF_WIN_LIBRARIES=aom" >> "$GITHUB_ENV"
4949
shell: bash
5050
- name: Install libdav1d library
5151
if: ${{ inputs.codec-dav1d == 'SYSTEM' }}

.github/workflows/ci-c-warnings.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ jobs:
3030
with:
3131
codec-aom: "SYSTEM"
3232
codec-dav1d: "SYSTEM"
33+
libjpeg-turbo: "SYSTEM"
3334
libyuv: "SYSTEM"
35+
zlibpng: "SYSTEM"
3436
- uses: ./.github/actions/setup-windows
3537
id: windows_setup
3638
if: runner.os == 'Windows'
3739
with:
3840
codec-aom: "SYSTEM"
3941
codec-dav1d: "SYSTEM"
42+
libjpeg-turbo: "SYSTEM"
4043
libyuv: "SYSTEM"
4144
zlibpng: "SYSTEM"
4245

.github/workflows/ci-disable-gtest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ jobs:
4444
codec-rav1e: "LOCAL"
4545
codec-svt: "LOCAL"
4646
gcc-version: ${{ matrix.gcc }}
47+
libjpeg-turbo: "SYSTEM"
4748
libyuv: "LOCAL"
49+
zlibpng: "SYSTEM"
4850

4951
- name: Prepare libavif (cmake)
5052
run: >

.github/workflows/ci-fuzztest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ jobs:
3333
with:
3434
codec-aom: "LOCAL"
3535
codec-dav1d: "LOCAL"
36+
libjpeg-turbo: "SYSTEM"
3637
libxml2: "LOCAL"
3738
libyuv: ${{ matrix.libyuv }}
39+
zlibpng: "SYSTEM"
3840

3941
- name: Prepare libavif (cmake)
4042
run: >

.github/workflows/ci-linux-coverage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ jobs:
2626
with:
2727
codec-aom: "LOCAL"
2828
codec-dav1d: "LOCAL"
29+
libjpeg-turbo: "SYSTEM"
2930
libxml2: "LOCAL"
31+
zlibpng: "SYSTEM"
3032

3133
- name: Install LLVM
3234
run: sudo apt install -y llvm

.github/workflows/ci-linux-golden-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ jobs:
3333
codec-aom: "LOCAL"
3434
codec-dav1d: "LOCAL"
3535
gcc-version: ${{ matrix.gcc }}
36+
libjpeg-turbo: "SYSTEM"
3637
libxml2: "LOCAL"
3738
libyuv: "LOCAL"
39+
zlibpng: "SYSTEM"
3840
- name: Build mp4box
3941
if: steps.setup.outputs.ext-cache-hit != 'true'
4042
working-directory: ./ext

.github/workflows/ci-unix-shared-installed.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,24 @@ jobs:
4040
with:
4141
codec-aom: "SYSTEM"
4242
codec-dav1d: "SYSTEM"
43+
codec-rav1e: "SYSTEM"
44+
codec-svt: "SYSTEM"
4345
gcc-version: ${{ matrix.gcc }}
4446
gtest: "SYSTEM"
47+
libjpeg-turbo: "SYSTEM"
4548
libyuv: "SYSTEM"
4649
oldest-cmake: ${{ matrix.oldest-cmake }}
50+
zlibpng: "SYSTEM"
4751
- uses: ./.github/actions/setup-macos
4852
if: runner.os == 'macOS'
4953
with:
5054
codec-aom: "SYSTEM"
5155
codec-dav1d: "SYSTEM"
56+
codec-rav1e: "SYSTEM"
57+
codec-svt: "SYSTEM"
5258
gtest: "SYSTEM"
59+
libjpeg-turbo: "SYSTEM"
60+
zlibpng: "SYSTEM"
5361
- name: Disable libyuv on macOS
5462
# libyuv is not available with brew.
5563
if: runner.os == 'macOS'
@@ -61,7 +69,8 @@ jobs:
6169
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
6270
-DAVIF_CODEC_AOM=SYSTEM
6371
-DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_AOM_ENCODE=ON
64-
-DAVIF_CODEC_DAV1D=SYSTEM
72+
-DAVIF_CODEC_DAV1D=SYSTEM -DAVIF_CODEC_RAV1E=SYSTEM
73+
-DAVIF_CODEC_SVT=SYSTEM
6574
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
6675
-DAVIF_BUILD_TESTS=ON -DAVIF_GTEST=SYSTEM
6776
-DAVIF_BUILD_GDK_PIXBUF=ON -DCMAKE_INSTALL_PREFIX=./build/install

.github/workflows/ci-unix-shared-local.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ jobs:
3636
codec-aom: "LOCAL"
3737
codec-dav1d: "LOCAL"
3838
gcc-version: ${{ matrix.gcc }}
39+
libjpeg-turbo: "SYSTEM"
3940
libxml2: "LOCAL"
4041
libyuv: ${{ matrix.libyuv }}
42+
zlibpng: "SYSTEM"
4143
- uses: ./.github/actions/setup-macos
4244
if: runner.os == 'macOS'
4345
with:
4446
codec-aom: "LOCAL"
4547
codec-dav1d: "LOCAL"
48+
libjpeg-turbo: "SYSTEM"
49+
zlibpng: "SYSTEM"
4650

4751
- name: Prepare libavif (cmake)
4852
run: >

0 commit comments

Comments
 (0)