-
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 3.24 KB
/
ffmpeg-test.yml
File metadata and controls
97 lines (82 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: FFmpeg library test
on:
push:
branches: [main]
paths:
- ".github/workflows/ffmpeg-test.yml"
- "internal/builder/**"
- "*.gen.go"
workflow_dispatch:
permissions:
pull-requests: write
contents: write
jobs:
ffmpeg-test:
name: Build FFmpeg library for ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: linux
arch: amd64
runner: ubuntu-24.04
- os: linux
arch: arm64
runner: ubuntu-24.04-arm
- os: darwin
arch: amd64
runner: macos-15-intel
- os: darwin
arch: arm64
runner: macos-15
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
cache-bin: false
- uses: taiki-e/cache-cargo-install-action@v3
with:
tool: cargo-c
- name: Install Linux dependencies
if: matrix.os == 'linux'
run: sudo apt-get update && sudo apt-get install -y yasm nasm meson gperf python3
- name: Install macOS dependencies
if: matrix.os == 'darwin'
run: brew update && brew install yasm autoconf ragel meson nasm automake libtool python3
- name: Calculate file hashes
id: file-hashes
run: |
echo "libraries-hash=$(sha256sum internal/builder/libraries.go | cut -d' ' -f1 | head -c 8)" >> $GITHUB_OUTPUT
echo "buildsystems-hash=$(sha256sum internal/builder/buildsystems.go | cut -d' ' -f1 | head -c 8)" >> $GITHUB_OUTPUT
- name: Cache FFmpeg source downloads
uses: actions/cache@v5
with:
path: .build/downloads
# Workaround for GitHub Actions bug: https://github.com/actions/runner-images/issues/13341
# hashFiles() broken on macOS runners as of 2024-11-23, using calculated hash instead
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-${{ matrix.os == 'darwin' && steps.file-hashes.outputs.libraries-hash || hashFiles('internal/builder/libraries.go') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-
- name: Cache compiled dependencies
uses: actions/cache@v5
with:
path: |
.build/staging
.build/build
# Workaround for GitHub Actions bug: https://github.com/actions/runner-images/issues/13341
# hashFiles() broken on macOS runners as of 2024-11-23, using calculated hash instead
key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-${{ matrix.os == 'darwin' && format('{0}-{1}', steps.file-hashes.outputs.libraries-hash, steps.file-hashes.outputs.buildsystems-hash) || hashFiles('internal/builder/libraries.go', 'internal/builder/buildsystems.go') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-
- name: Build FFmpeg library
run: go run ./internal/builder/
- name: List built files
run: ls -lh lib/${{ matrix.os }}_${{ matrix.arch }}/