-
-
Notifications
You must be signed in to change notification settings - Fork 94
236 lines (216 loc) 路 7.5 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
on: [push, pull_request]
name: Continuous integration
jobs:
# Lints are going first, since it is cheap to run them
# and we want to fail as fast as possible
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
# That also includes `examples` and `benchmarks` crates,
# which are ignored by default by the workspace
args: --all -- --check
clippy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- name: Cache cargo build target
uses: actions/cache@v1
with:
path: target
key: clippy-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: beta
override: true
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
# `examples` and `benchmarks` are checked separately due to enabled `runtime-tokio` feature
# which clashes with default feature for other sub-crates.
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -p examples -p benchmarks --all-targets -- -D warnings
# Now, let's check that code compiles at least
compile:
name: ${{ matrix.toolchain }} / ${{ matrix.triple.target }}
needs: [rustfmt, clippy]
runs-on: ${{ matrix.triple.os }}
strategy:
fail-fast: false
matrix:
triple:
# Tier 1 platforms
- { os: 'ubuntu-latest', target: 'x86_64-unknown-linux-gnu', cross: false }
- { os: 'ubuntu-latest', target: 'i686-unknown-linux-gnu', cross: true }
- { os: 'macOS-latest', target: 'x86_64-apple-darwin', cross: false }
# TODO: cross does not support it
# - { os: 'windows-latest', target: 'i686-pc-windows-msvc', cross: true }
- { os: 'windows-latest', target: 'x86_64-pc-windows-msvc', cross: false }
# Tier 2 platforms
## ARM64
- { os: 'ubuntu-latest', target: 'aarch64-unknown-linux-gnu', cross: true }
- { os: 'ubuntu-latest', target: 'aarch64-unknown-linux-musl', cross: true }
## ARMv7
- { os: 'ubuntu-latest', target: 'armv7-unknown-linux-gnueabihf', cross: true }
- { os: 'ubuntu-latest', target: 'armv7-unknown-linux-musleabihf', cross: true }
## ARMv6
- { os: 'ubuntu-latest', target: 'arm-unknown-linux-gnueabihf', cross: true }
- { os: 'ubuntu-latest', target: 'arm-unknown-linux-musleabihf', cross: true }
toolchain:
- 1.39.0 # MSRV
- stable
# For sake of not creating incredibly huge additional matrix dimension,
# code compilation check will be executed only with `runtime-polyfill` feature enabled.
runtime:
- runtime-polyfill
steps:
- uses: actions/checkout@v2
# Cache
- name: Cache rustup toolchain
uses: actions/cache@v1
with:
path: ~/.rustup/toolchains
key: rustup-toolchain-${{ matrix.toolchain }}
- name: Cache cargo build target
if: matrix.toolchain != 'nightly'
uses: actions/cache@v1
with:
path: target
key: compile-${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.triple.target }}-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --features full,${{ matrix.runtime }} --target=${{ matrix.triple.target }} --manifest-path=heim/Cargo.toml
use-cross: ${{ matrix.triple.cross }}
# Now checking if integration with async runtimes works correctly
# Checks are executed for Tier 1 platforms only
runtimes:
name: ${{ matrix.runtime }} / ${{ matrix.os }}
needs: [rustfmt, clippy]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
toolchain:
- 1.39.0 # MSRV
- stable
runtime:
- runtime-tokio
- runtime-async-std
- runtime-polyfill
steps:
- uses: actions/checkout@v2
- name: Cache rustup toolchain
uses: actions/cache@v1
with:
path: ~/.rustup/toolchains
key: rustup-toolchain-${{ matrix.toolchain }}
- name: Cache cargo build target
if: matrix.toolchain != 'nightly'
uses: actions/cache@v1
with:
path: target
key: runtime-${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- name: Check runtime integration
uses: actions-rs/cargo@v1
with:
command: check
args: --features full,${{ matrix.runtime }} --manifest-path=heim/Cargo.toml
# Test suite is executed for Tier 1 platforms now,
# which mean we can do that natively on the Actions VMs
tests:
needs: [compile, runtimes]
name: Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
# We need nightly for `-Zprofile`
toolchain:
- nightly
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- name: Execute tests (not macOS)
if: startsWith(matrix.os, 'macOS') == false
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads"
- name: Execute tests (macOS)
if: startsWith(matrix.os, 'macOS') == true
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Coverflow-checks=off -Zno-landing-pads"
- name: Gather coverage data
id: coverage
uses: actions-rs/grcov@v0.1
with:
coveralls-token: ${{ secrets.COVERALLS_TOKEN }}
- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: ${{ steps.coverage.outputs.report }}
code_coverage_finalize:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Coveralls finalization
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true