-
-
Notifications
You must be signed in to change notification settings - Fork 1
222 lines (193 loc) · 6.57 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
name: Rust
on:
push:
branches: [master]
paths-ignore:
- ".gitignore"
- ".git-blame-ignore-revs"
pull_request:
branches: [master]
paths-ignore:
- ".gitignore"
- ".git-blame-ignore-revs"
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Check
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install Rust (stable)
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features
test:
name: Test
runs-on: ${{ matrix.os }}
needs: check
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
toolchain: [stable, beta, nightly, "1.60"]
include:
- os: windows-latest
toolchain: nightly
- os: macos-latest
toolchain: nightly
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: true
- name: Install ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt
- name: Install cargo-hack
uses: taiki-e/install-action@v1
with:
tool: cargo-hack
- name: Cargo test
id: tests
uses: alexschrod/action-rs-cargo@feat/stdout-stderr
env:
RUST_BACKTRACE: 1
with:
command: hack
args: --feature-powerset --keep-going test --message-format=json --no-fail-fast --workspace
stdout-file: tests.json
- name: Cargo metadata
id: metadata
if: always()
uses: alexschrod/action-rs-cargo@feat/stdout-stderr
with:
command: metadata
args: --format-version 1
stdout-file: metadata.json
- name: Create test annotations
if: always()
uses: alexschrod/cargo-test-annotations@master
with:
metadata: "metadata.json"
tests: "tests.json"
token: ${{ secrets.GITHUB_TOKEN }}
name: cargo-test-annotations (${{ matrix.os }}, ${{ matrix.toolchain }})
miri:
name: Miri
runs-on: ubuntu-latest
needs: check
continue-on-error: true
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: miri
- name: Setup miri
run: cargo miri setup
- name: Run miri
run: cargo miri test --all-features
style:
name: Check Style
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy, rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
coverage:
name: Report coverage
runs-on: ubuntu-latest
needs: test
if: github.event_name != 'pull_request'
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Generate code coverage
run: |
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
- name: Upload coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
docs:
name: Documentation
runs-on: ubuntu-latest
needs: check
if: github.event_name != 'pull_request'
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Build documentation
uses: actions-rs/cargo@v1
env:
RUSTDOCFLAGS: --cfg docsrs
with:
command: doc
args: --verbose --no-deps --all-features --workspace
- name: Finalize documentation
run: |
#CRATE_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]' | cut -f2 -d"/")
#echo "<meta http-equiv=\"refresh\" content=\"0; url=${CRATE_NAME/-/_}\">" > target/doc/index.html
echo "<meta http-equiv=\"refresh\" content=\"0; url=nombytes\">" > target/doc/index.html
touch target/doc/.nojekyll
- name: Upload as artifact
uses: actions/upload-artifact@v2
with:
name: Documentation
path: target/doc
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/doc