Skip to content

Commit 1a1bee8

Browse files
committed
CI Linux: simplify caches
handle cache build/install (transitively) in prepare.sh
1 parent ed78a76 commit 1a1bee8

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

.github/scripts/Linux/install_ffmpeg.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,9 @@ install_cached() {
124124
sudo ldconfig
125125
}
126126

127-
"${1?action required!}"
127+
deps
128+
if [ -d $cache_dir ]; then
129+
install_cached
130+
else
131+
build_install
132+
fi

.github/scripts/Linux/install_others.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ install_rav1e() {(
6666

6767
# FFmpeg master needs at least v1.3.277 as for 6th Mar '25
6868
install_vulkan() {(
69+
sudo apt build-dep libvulkan1
6970
git clone --depth 1 https://github.com/KhronosGroup/Vulkan-Headers
7071
mkdir Vulkan-Headers/build
7172
cd Vulkan-Headers/build

.github/scripts/Linux/install_sdl.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,9 @@ install_cached() {
4646
sudo cmake --install fluidsynth/build
4747
}
4848

49-
"${1?action required!}"
49+
deps
50+
if [ -d $cache_dir ]; then
51+
install_cached
52+
else
53+
build_install
54+
fi

.github/scripts/Linux/prepare.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ sudo apt install libopencv-core-dev libopencv-imgproc-dev
3535
sudo apt install libcurl4-openssl-dev # for RTSP client (vidcap)
3636
sudo apt install i965-va-driver-shaders libva-dev # instead of i965-va-driver
3737

38-
"$dir/install_sdl.sh" deps
39-
"$dir/install_ffmpeg.sh" deps
40-
4138
sudo apt install qt6-base-dev qt6-wayland
4239
. /etc/os-release # source ID and VERSION_ID
4340
if [ "$ID" = ubuntu ] && [ "$VERSION_ID" = 22.04 ]; then
@@ -53,3 +50,6 @@ qt6.conf" "/usr/lib/$(uname -m)-linux-gnu/qt-default/qtchooser/default.conf"
5350

5451
"$GITHUB_WORKSPACE/.github/scripts/Linux/install_others.sh"
5552

53+
"$dir"/install_sdl.sh
54+
"$dir"/install_ffmpeg.sh
55+

.github/scripts/install-common-deps.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ download_build_aja() {
4949
}
5050

5151
install_aja() {(
52+
if [ "$(uname -s)" = Linux ]; then
53+
sudo apt install libudev-dev
54+
fi
5255
if [ ! -d libajantv2 ]; then
5356
download_build_aja
5457
fi

.github/workflows/ccpp.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -75,34 +75,20 @@ jobs:
7575
if: steps.cache-ndi.outputs.cache-hit != 'true'
7676
run: "curl -Lf https://downloads.ndi.tv/SDK/NDI_SDK_Linux/\
7777
Install_NDI_SDK_v6_Linux.tar.gz -o /var/tmp/Install_NDI_SDK_Linux.tar.gz"
78-
- name: bootstrap
79-
run: |
80-
. .github/scripts/environment.sh
81-
.github/scripts/Linux/prepare.sh
82-
- name: Run actions/cache for FFmpeg
83-
id: cache-ffmpeg
78+
- name: Cache FFmpeg
8479
uses: actions/cache@main
8580
with:
8681
path: '/var/tmp/ffmpeg'
87-
key: cache-ffmpeg-${{ runner.os }}-${{ hashFiles( '.github/scripts/Linux/install_ffmpeg.sh', '.github/scripts/Linux/ffmpeg-patches/*') }}
88-
- name: Build FFmpeg
89-
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
90-
run: .github/scripts/Linux/install_ffmpeg.sh build_install
91-
- name: Install Cached FFmpeg
92-
if: steps.cache-ffmpeg.outputs.cache-hit == 'true'
93-
run: .github/scripts/Linux/install_ffmpeg.sh install_cached
82+
key: cache-ffmpeg-${{ runner.os }}-${{ hashFiles( '.github/scripts/Linux/install_ffmpeg.sh', '.github/scripts/Linux/install_other.sh', '.github/scripts/Linux/ffmpeg-patches/*') }}
9483
- name: Cache SDL
95-
id: cache-sdl
9684
uses: actions/cache@main
9785
with:
9886
path: '/var/tmp/sdl'
9987
key: cache-sdl-${{ runner.os }}-${{ hashFiles( '.github/scripts/Linux/install_sdl.sh' ) }}
100-
- name: Build SDL
101-
if: steps.cache-sdl.outputs.cache-hit != 'true'
102-
run: .github/scripts/Linux/install_sdl.sh build_install
103-
- name: Install Cached SDL
104-
if: steps.cache-sdl.outputs.cache-hit == 'true'
105-
run: .github/scripts/Linux/install_sdl.sh install_cached
88+
- name: bootstrap
89+
run: |
90+
. .github/scripts/environment.sh
91+
.github/scripts/Linux/prepare.sh
10692
- name: configure
10793
run: "./autogen.sh $FEATURES || { RC=$?; cat config.log; exit $RC; }"
10894
- name: make

0 commit comments

Comments
 (0)