-
Notifications
You must be signed in to change notification settings - Fork 79
187 lines (177 loc) · 4.72 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
name: CI
on:
pull_request:
push:
branches:
- master
env:
RUST_BACKTRACE: 1
toolchain_style: stable
toolchain_msrv: 1.63
toolchain_h3_quinn_msrv: 1.63
toolchain_doc: nightly-2023-10-21
toolchain_lint: stable
toolchain_fuzz: nightly-2023-10-21
jobs:
ci-pass:
name: CI is green
runs-on: ubuntu-latest
needs:
- style
- lint
- msrv
- msrv_h3_quinn
- test
- doc
- fuzz
steps:
- run: exit 0
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.toolchain_style }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.toolchain_style }}
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: cargo fmt --all -- --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.toolchain_lint }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.toolchain_lint }}
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
msrv:
name: Check MSRV
needs: [style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.toolchain_msrv }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.toolchain_msrv }}
override: true
- uses: Swatinem/rust-cache@v2
- name: cargo check -p h3
uses: actions-rs/cargo@v1
with:
command: check
args: -p h3
msrv_h3_quinn:
name: Check MSRV of `h3-quinn`
needs: [style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.toolchain_h3_quinn_msrv }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.toolchain_h3_quinn_msrv }}
override: true
- uses: Swatinem/rust-cache@v2
- name: cargo check -p h3-quinn
uses: actions-rs/cargo@v1
with:
command: check
args: -p h3-quinn
test:
name: Test ${{ matrix.toolchain }} ${{ matrix.os }}
needs: [style]
strategy:
matrix:
os: [ubuntu-latest]
toolchain: [stable, beta]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- uses: Swatinem/rust-cache@v2
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
- name: h3Spec
run: ./ci/h3spec.sh
if: matrix.toolchain == 'stable'
doc:
name: Build docs
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.toolchain_doc }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.toolchain_doc }}
override: true
- uses: Swatinem/rust-cache@v2
- name: cargo rustdoc -p h3 -- -D intra-doc-link-resolution-failure
uses: actions-rs/cargo@v1
with:
command: rustdoc
args: -p h3 -- -D intra-doc-link-resolution-failure
fuzz:
name: Fuzz test
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.toolchain_fuzz }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.toolchain_fuzz }}
override: true
- uses: Swatinem/rust-cache@v2
- name: Install cargo-fuzz
uses: camshaft/install@v1
with:
crate: cargo-fuzz
- name: cargo fuzz run fuzz_varint -- -runs=1
uses: actions-rs/cargo@v1
with:
command: fuzz
args: run fuzz_varint -- -runs=1
compliance:
name: Compliance report
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Generate compliance report
uses: ./.github/actions/compliance
with:
extract-script: ${{ github.workspace }}/ci/compliance/extract.sh
report-script: ${{ github.workspace }}/ci/compliance/report.sh