forked from zmwangx/rust-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (141 loc) · 4.38 KB
/
build.yml
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: build
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
build-test-lint-linux:
name: Linux - FFmpeg ${{ matrix.ffmpeg_version }} - build, test and lint
runs-on: ubuntu-latest
container: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu
strategy:
matrix:
ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "6.0", "6.1", "7.0"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
apt update
apt install -y --no-install-recommends clang curl pkg-config
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Build
run: |
cargo build --examples
- name: Test
run: |
cargo test --examples
- name: Lint
run: |
cargo clippy --examples -- -D warnings
- name: Check format
run: |
cargo fmt -- --check
build-test-lint-macos:
name: macOS - FFmpeg latest - build, test and lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
brew install ffmpeg pkg-config
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Build
run: |
cargo build --examples
- name: Test
run: |
cargo test --examples
- name: Lint
run: |
cargo clippy --examples -- -D warnings
- name: Check format
run: |
cargo fmt -- --check
build-test-lint-windows:
name: Windows - FFmpeg ${{ matrix.ffmpeg_version }} - build, test and lint
runs-on: windows-latest
strategy:
matrix:
include:
- ffmpeg_version: latest
ffmpeg_download_url: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z
fail-fast: false
env:
FFMPEG_DOWNLOAD_URL: ${{ matrix.ffmpeg_download_url }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
$VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)
Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n"
Invoke-WebRequest "${env:FFMPEG_DOWNLOAD_URL}" -OutFile ffmpeg-release-full-shared.7z
7z x ffmpeg-release-full-shared.7z
mkdir ffmpeg
mv ffmpeg-*/* ffmpeg/
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n"
Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n"
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Build
run: |
cargo build --examples
- name: Test
run: |
cargo test --examples
- name: Lint
run: |
cargo clippy --examples -- -D warnings
- name: Check format
run: |
cargo fmt -- --check
# Added only because there is no ffmpeg7.1 docker image here yet
# https://github.com/jrottenberg/ffmpeg
build-test-lint-7-1:
name: FFmpeg 7.1 - build, test and lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
FFMPEG_DIR: /home/runner/work/rust-ffmpeg/rust-ffmpeg/ffmpeg-7.1-linux-clang-default
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y --no-install-recommends clang curl pkg-config xz-utils libxv-dev
curl -L https://sourceforge.net/projects/avbuild/files/linux/ffmpeg-7.1-linux-clang-default.tar.xz/download -o ffmpeg.tar.xz
tar -xf ffmpeg.tar.xz
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Build
run: |
cargo build --examples
- name: Test
run: |
cargo test --examples
- name: Lint
run: |
cargo clippy --examples -- -D warnings
- name: Check format
run: |
cargo fmt -- --check