7
7
8
8
env :
9
9
RUST_BACKTRACE : 1
10
+ toolchain_style : stable
11
+ toolchain_msrv : 1.56
12
+ toolchain_doc : nightly-2022-12-01
13
+ toolchain_lint : stable
14
+ toolchain_fuzz : nightly-2022-12-01
10
15
11
16
jobs :
12
17
ci-pass :
13
18
name : CI is green
14
19
runs-on : ubuntu-latest
15
20
needs :
16
21
- style
17
- - build
22
+ - lint
23
+ - msrv
18
24
- test
19
25
- doc
20
- - lint
21
26
- fuzz
22
27
steps :
23
28
- run : exit 0
@@ -26,166 +31,134 @@ jobs:
26
31
name : Check Style
27
32
runs-on : ubuntu-latest
28
33
steps :
29
- - name : Checkout
30
- uses : actions/checkout@v1
31
-
32
- - name : Install Rust
34
+ - uses : actions/checkout@v3
35
+ - name : Install Rust ${{ env.toolchain_style }}
33
36
uses : actions-rs/toolchain@v1
34
37
with :
35
38
profile : minimal
36
- toolchain : stable
39
+ toolchain : ${{ env.toolchain_style }}
37
40
override : true
38
41
components : rustfmt
39
-
40
- - name : cargo fmt --check
42
+ - uses : Swatinem/rust-cache@v2
43
+ - name : cargo fmt --all -- -- check
41
44
uses : actions-rs/cargo@v1
42
45
with :
43
46
command : fmt
44
47
args : --all -- --check
45
48
46
- build :
47
- name : Build
48
- strategy :
49
- matrix :
50
- rust :
51
- - stable
52
- - beta
53
- - nightly
54
- - " 1.59"
49
+ lint :
50
+ name : Lint
55
51
runs-on : ubuntu-latest
56
52
steps :
57
- - name : Checkout
58
- uses : actions/checkout@v1
59
-
60
- - name : Install Rust (${{ matrix.rust }})
53
+ - uses : actions/checkout@v3
54
+ - name : Install Rust ${{ env.toolchain_lint }}
61
55
uses : actions-rs/toolchain@v1
62
56
with :
63
57
profile : minimal
64
- toolchain : ${{ matrix.rust }}
58
+ toolchain : ${{ env.toolchain_lint }}
65
59
override : true
60
+ components : clippy
61
+ - uses : Swatinem/rust-cache@v2
62
+ - name : cargo clippy
63
+ uses : actions-rs/cargo@v1
64
+ with :
65
+ command : clippy
66
66
67
- - name : cargo build
67
+ msrv :
68
+ name : Check MSRV
69
+ needs : [style]
70
+ runs-on : ubuntu-latest
71
+ steps :
72
+ - uses : actions/checkout@v3
73
+ - name : Install Rust ${{ env.toolchain_msrv }}
74
+ uses : actions-rs/toolchain@v1
75
+ with :
76
+ profile : minimal
77
+ toolchain : ${{ env.toolchain_msrv }}
78
+ override : true
79
+ - uses : Swatinem/rust-cache@v2
80
+ - name : cargo check --workspace
68
81
uses : actions-rs/cargo@v1
69
82
with :
70
- command : build
71
- args : -p h3
83
+ command : check
84
+ args : --workspace
72
85
73
86
test :
74
- name : Test ${{ matrix.rust }}
87
+ name : Test ${{ matrix.toolchain }} ${{ matrix.os }}
75
88
needs : [style]
76
89
strategy :
77
90
matrix :
78
- rust :
79
- - stable
80
- - beta
81
- - nightly
82
- - " 1.59"
83
-
84
- runs-on : ubuntu-latest
85
-
91
+ os : [ubuntu-latest]
92
+ toolchain : [stable, beta]
93
+ runs-on : ${{ matrix.os }}
86
94
steps :
87
- - name : Checkout
88
- uses : actions/checkout@v1
89
-
90
- - name : Install Rust (${{ matrix.rust }})
95
+ - uses : actions/checkout@v3
96
+ - name : Install Rust ${{ matrix.toolchain }}
91
97
uses : actions-rs/toolchain@v1
92
98
with :
93
99
profile : minimal
94
- toolchain : ${{ matrix.rust }}
100
+ toolchain : ${{ matrix.toolchain }}
95
101
override : true
96
-
97
- - name : Test
102
+ - uses : Swatinem/rust-cache@v2
103
+ - name : cargo test
98
104
uses : actions-rs/cargo@v1
99
105
with :
100
106
command : test
101
-
102
107
- name : h3Spec
103
108
run : ./ci/h3spec.sh
104
- if : matrix.rust == 'stable'
109
+ if : matrix.toolchain == 'stable'
105
110
106
111
doc :
107
112
name : Build docs
108
- needs : [style, test]
113
+ needs : [test]
109
114
runs-on : ubuntu-latest
110
115
steps :
111
- - name : Checkout
112
- uses : actions/checkout@v1
113
-
114
- - name : Install Rust
116
+ - uses : actions/checkout@v3
117
+ - name : Install Rust ${{ env.toolchain_doc }}
115
118
uses : actions-rs/toolchain@v1
116
119
with :
117
120
profile : minimal
118
- toolchain : nightly
121
+ toolchain : ${{ env.toolchain_doc }}
119
122
override : true
120
-
121
- - name : cargo doc
123
+ - uses : Swatinem/rust-cache@v2
124
+ - name : cargo rustdoc -p h3 -- -D intra- doc-link-resolution-failure
122
125
uses : actions-rs/cargo@v1
123
126
with :
124
127
command : rustdoc
125
128
args : -p h3 -- -D intra-doc-link-resolution-failure
126
129
127
- lint :
128
- name : Lint
129
- runs-on : ubuntu-latest
130
- steps :
131
- - name : Checkout
132
- uses : actions/checkout@v1
133
-
134
- - name : Install Rust
135
- uses : actions-rs/toolchain@v1
136
- with :
137
- profile : minimal
138
- toolchain : stable
139
- override : true
140
- components : clippy
141
-
142
- - name : cargo clippy
143
- uses : actions-rs/cargo@v1
144
- with :
145
- command : clippy
146
-
147
130
fuzz :
148
131
name : Fuzz test
149
- needs : [style, test]
150
- strategy :
151
- matrix :
152
- rust :
153
- - nightly
154
-
132
+ needs : [test]
155
133
runs-on : ubuntu-latest
156
-
157
134
steps :
158
- - name : Checkout
159
- uses : actions/checkout@v1
160
-
161
- - name : Install Rust (${{ matrix.rust }})
135
+ - uses : actions/checkout@v3
136
+ - name : Install Rust ${{ env.toolchain_fuzz }}
162
137
uses : actions-rs/toolchain@v1
163
138
with :
164
139
profile : minimal
165
- toolchain : ${{ matrix.rust }}
140
+ toolchain : ${{ env.toolchain_fuzz }}
166
141
override : true
167
-
168
- - name : install cargo-fuzz
169
- uses : actions-rs/cargo @v1
142
+ - uses : Swatinem/rust-cache@v2
143
+ - name : Install cargo-fuzz
144
+ uses : camshaft/install @v1
170
145
with :
171
- command : install
172
- args : cargo-fuzz
173
-
174
- - name : Fuzz
146
+ crate : cargo-fuzz
147
+ - name : cargo fuzz run fuzz_varint -- -runs=1
175
148
uses : actions-rs/cargo@v1
176
149
with :
177
- command : +nightly
178
- args : fuzz run fuzz_varint -- -runs=1
150
+ command : fuzz
151
+ args : run fuzz_varint -- -runs=1
179
152
180
153
compliance :
181
154
name : Compliance report
155
+ needs : [test]
182
156
runs-on : ubuntu-latest
183
157
steps :
184
158
- uses : actions/checkout@v3
185
159
with :
186
160
persist-credentials : false
187
161
fetch-depth : 0
188
-
189
162
- name : Generate compliance report
190
163
uses : ./.github/actions/compliance
191
164
with :
0 commit comments