Skip to content

Commit 5026fdd

Browse files
committed
fix(workflows): add workaround for hashFiles bug on macOS runners
- Implements workaround for GitHub Actions bug (actions/runner-images#13341) - Uses static cache key 'static-v1' for macOS runners instead of hashFiles - Adds conditional logic to prevent cache key generation issues - Applies fix to both ffmpeg-release.yml and ffmpeg-test.yml workflow files
1 parent 64505d1 commit 5026fdd

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/ffmpeg-release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ jobs:
5858
path: |
5959
~/go/pkg/mod
6060
~/.cache/go-build
61-
key: ${{ runner.os }}-${{ runner.arch }}-go-${{ hashFiles('go.sum', 'go.mod') }}
61+
# Workaround for GitHub Actions bug: https://github.com/actions/runner-images/issues/13341
62+
# hashFiles() broken on macOS runners as of 2024-11-23, using static key temporarily
63+
key: ${{ runner.os }}-${{ runner.arch }}-go-${{ matrix.os == 'darwin' && 'static-v1' || hashFiles('go.sum', 'go.mod') }}
6264
restore-keys: |
6365
${{ runner.os }}-${{ runner.arch }}-go-
6466
@@ -94,7 +96,9 @@ jobs:
9496
uses: actions/cache@v4
9597
with:
9698
path: .build/downloads
97-
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-${{ hashFiles('internal/builder/libraries.go') }}
99+
# Workaround for GitHub Actions bug: https://github.com/actions/runner-images/issues/13341
100+
# hashFiles() broken on macOS runners as of 2024-11-23, using static key temporarily
101+
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-${{ matrix.os == 'darwin' && 'static-v1' || hashFiles('internal/builder/libraries.go') }}
98102
restore-keys: |
99103
${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-
100104
@@ -104,7 +108,9 @@ jobs:
104108
path: |
105109
.build/staging
106110
.build/build
107-
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-${{ hashFiles('internal/builder/libraries.go', 'internal/builder/buildsystems.go') }}
111+
# Workaround for GitHub Actions bug: https://github.com/actions/runner-images/issues/13341
112+
# hashFiles() broken on macOS runners as of 2024-11-23, using static key temporarily
113+
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-${{ matrix.os == 'darwin' && 'static-v1' || hashFiles('internal/builder/libraries.go', 'internal/builder/buildsystems.go') }}
108114
restore-keys: |
109115
${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-
110116

.github/workflows/ffmpeg-test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ jobs:
4949
path: |
5050
~/go/pkg/mod
5151
~/.cache/go-build
52-
key: ${{ runner.os }}-${{ runner.arch }}-go-${{ hashFiles('go.sum', 'go.mod') }}
52+
# Workaround for GitHub Actions bug: https://github.com/actions/runner-images/issues/13341
53+
# hashFiles() broken on macOS runners as of 2024-11-23, using static key temporarily
54+
key: ${{ runner.os }}-${{ runner.arch }}-go-${{ matrix.os == 'darwin' && 'static-v1' || hashFiles('go.sum', 'go.mod') }}
5355
restore-keys: |
5456
${{ runner.os }}-${{ runner.arch }}-go-
5557
@@ -85,7 +87,9 @@ jobs:
8587
uses: actions/cache@v4
8688
with:
8789
path: .build/downloads
88-
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-${{ hashFiles('internal/builder/libraries.go') }}
90+
# Workaround for GitHub Actions bug: https://github.com/actions/runner-images/issues/13341
91+
# hashFiles() broken on macOS runners as of 2024-11-23, using static key temporarily
92+
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-${{ matrix.os == 'darwin' && 'static-v1' || hashFiles('internal/builder/libraries.go') }}
8993
restore-keys: |
9094
${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-
9195
@@ -95,7 +99,9 @@ jobs:
9599
path: |
96100
.build/staging
97101
.build/build
98-
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-${{ hashFiles('internal/builder/libraries.go', 'internal/builder/buildsystems.go') }}
102+
# Workaround for GitHub Actions bug: https://github.com/actions/runner-images/issues/13341
103+
# hashFiles() broken on macOS runners as of 2024-11-23, using static key temporarily
104+
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-${{ matrix.os == 'darwin' && 'static-v1' || hashFiles('internal/builder/libraries.go', 'internal/builder/buildsystems.go') }}
99105
restore-keys: |
100106
${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-
101107

0 commit comments

Comments
 (0)