-
Notifications
You must be signed in to change notification settings - Fork 2
199 lines (188 loc) · 5.91 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Cargo Test
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
cargo-test-linux:
name: Build and Test (Linux${{ contains(matrix.target, 'musl') && ', musl' || '' }}${{ matrix.features != 'default' && format(', {0}', matrix.features) || '' }})
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
features:
- default
- unnamed-tmpfile
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build and Test
run: |
export TEST_DIR=$RUNNER_TEMP
cargo test --target ${{ matrix.target }} --features ${{ matrix.features }} --release --verbose
- name: Lint
run: |
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check
cargo-test-linux-overlayfs:
name: Build and Test (Linux, overlayfs)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build and Test
run: |
mkdir $RUNNER_TEMP/lower
mkdir $RUNNER_TEMP/upper
mkdir $RUNNER_TEMP/work
mkdir $RUNNER_TEMP/merged
export TEST_DIR=$RUNNER_TEMP/merged
export TEST_DIR_SUPPORTS_UNNAMED=false
sudo mount -t overlay none -o lowerdir=$RUNNER_TEMP/lower,upperdir=$RUNNER_TEMP/upper,workdir=$RUNNER_TEMP/work $TEST_DIR
cargo test --release --verbose
cargo-test-macos:
name: Build and Test (MacOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build and Test
run: |
export TEST_DIR=$RUNNER_TEMP
cargo test --release --verbose
- name: Lint
run: |
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check
cargo-test-windows:
name: Build and Test (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build and Test
run: |
set TEST_DIR=%RUNNER_TEMP%
cargo test --release --verbose
- name: Lint
run: |
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check
cargo-test-wasi:
name: Build (wasi)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip1
- name: Install cargo-wasi
run: |
cargo install --locked cargo-wasi
- name: Build
run: |
cargo wasi build --release --verbose
- name: Lint
run: |
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check
cross-test:
name: Build and Test (${{ matrix.target }}, using cross-compilation)
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- arm-linux-androideabi
- arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- armv5te-unknown-linux-gnueabi
- armv5te-unknown-linux-musleabi
- armv7-linux-androideabi
- armv7-unknown-linux-gnueabi
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabi
- armv7-unknown-linux-musleabihf
- i586-unknown-linux-gnu
- i586-unknown-linux-musl
- i686-unknown-linux-gnu
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- s390x-unknown-linux-gnu
- sparc64-unknown-linux-gnu
- thumbv7neon-linux-androideabi
- thumbv7neon-unknown-linux-gnueabihf
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cross
run: |
cargo install --locked cross
- name: Test
run: |
cross test --target=${{ matrix.target }} --release --verbose
cross-build:
name: Build (${{ matrix.target }}, using cross-compilation)
runs-on: ubuntu-latest
strategy:
matrix:
target:
- i686-linux-android
- i686-pc-windows-gnu
- i686-unknown-freebsd
- sparcv9-sun-solaris
- x86_64-linux-android
- x86_64-pc-windows-gnu
- x86_64-unknown-freebsd
- x86_64-unknown-freebsd
- x86_64-unknown-illumos
- x86_64-unknown-illumos
- x86_64-unknown-netbsd
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cross
run: |
cargo install --locked cross
- name: Build
run: |
cross build --target=${{ matrix.target }} --release --verbose
cargo-test-all-features:
name: Build and Test (all features combinations)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-all-features
run: |
cargo install --locked cargo-all-features
- name: Build and Test
run: |
export TEST_DIR=$RUNNER_TEMP
cargo +nightly test-all-features --release --verbose
- name: Lint
run: |
cargo +nightly check-all-features --all-targets
lint-crash-tests:
name: Lint Crash Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Lint
run: |
cd crash-tests/linux
cargo clippy --all-targets -- --deny=warnings
cargo fmt --check