-
Notifications
You must be signed in to change notification settings - Fork 10
108 lines (86 loc) · 2.92 KB
/
ci-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
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
clippy-rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy, rustfmt
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check --verbose
- name: Install ffmpeg for Ubuntu
run: |
export PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config)
sudo apt-get update
sudo apt-get install libavutil-dev libavcodec-dev libavformat-dev libclang-dev
- name: Run cargo clippy (y4m)
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --tests --benches -- -D warnings
- name: Run cargo clippy (ffmpeg)
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --features ffmpeg --tests --benches -- -D warnings
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install FFmpeg for Ubuntu
if: matrix.platform == 'ubuntu-latest'
run: |
export PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config)
sudo apt-get update
sudo apt-get install libavutil-dev libavcodec-dev libavformat-dev libclang-dev
- name: Install FFmpeg for MacOs
if: matrix.platform == 'macos-latest'
run: |
brew install ffmpeg pkg-config
- name: Install FFmpeg for Windows
if: matrix.platform == 'windows-latest'
env:
FFMPEG_URL: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z
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_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: Build (y4m)
run: cargo build --tests --benches
- name: Run tests (y4m)
run: cargo test
- name: Build (ffmpeg)
run: cargo build --features ffmpeg --tests --benches
- name: Run tests (ffmpeg)
run: cargo test --features ffmpeg
- name: Generate docs
run: cargo doc --features y4m,ffmpeg --no-deps