-
Notifications
You must be signed in to change notification settings - Fork 18
125 lines (102 loc) · 3.23 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches:
- master
env:
RUST_BACKTRACE: full
jobs:
rustfmt:
name: rustfmt / linux / stable
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install rust
run: |
rustup update --no-self-update stable
rustup component add rustfmt
- name: cargo fmt -- --check
run: |
cargo fmt --all -- --check
clippy:
name: clippy / linux / stable
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y ninja-build nasm meson
- name: Install rust
run: |
rustup update --no-self-update stable
rustup component add clippy
- name: cargo clippy --all --examples
run:
cargo clippy --all --examples
test:
name: test / ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-20.04' }}
strategy:
matrix:
include:
- name: linux / stable
rust: stable
- name: linux / stable / codec-aom
features: "--no-default-features --features codec-aom"
- name: linux / beta
rust: beta
- name: linux / nightly
rust: nightly
- name: linux / 1.36.0
rust: 1.36.0
- name: macOS / stable
os: macOS-latest
- name: windows / stable
os: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies (linux)
if: (matrix.os || 'ubuntu-20.04') == 'ubuntu-20.04'
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y ninja-build nasm meson
- name: Install dependencies (macOS)
if: matrix.os == 'macOS-latest'
run: |
brew install ninja nasm meson
- name: Install dependencies (windows)
if: matrix.os == 'windows-latest'
run: |
choco install -y ninja
pip install meson
- name: Install nasm (windows)
if: matrix.os == 'windows-latest'
run: |
$NASM_VERSION="2.15.02"
$LINK="https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64"
curl -LO "$LINK/nasm-$NASM_VERSION-win64.zip"
7z e -y "nasm-$NASM_VERSION-win64.zip" -o"C:\nasm"
echo "::add-path::C:\nasm"
- name: Install rust
run: |
rustup default ${{ matrix.rust || 'stable' }}
rustup update --no-self-update ${{ matrix.rust || 'stable' }}
- name: Test (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cargo test ${{ matrix.features }} --all
- name: Test (Linux, macOS)
if: matrix.os != 'windows-latest'
run: |
cargo test ${{ matrix.features }} --all