@@ -2,40 +2,37 @@ name: CI
2
2
3
3
on : [push, pull_request]
4
4
5
+ env :
6
+ CARGO_INCREMENTAL : ' 0'
7
+ CARGO_PROFILE_DEV_DEBUG : ' 0'
8
+ CARGO_PROFILE_TEST_DEBUG : ' 0'
9
+ CARGO_TERM_COLOR : always
10
+
5
11
jobs :
6
12
fmt :
7
13
name : Rustfmt
8
14
runs-on : ubuntu-latest
9
15
steps :
10
- - uses : actions/checkout@v2
11
- - name : Install Rust toolchain
12
- uses : actions-rs/toolchain@v1
13
- with :
14
- toolchain : stable
15
- profile : minimal
16
- components : rustfmt
17
- - name : cargo fmt -- --check
18
- uses : actions-rs/cargo@v1
19
- with :
20
- command : fmt
21
- args : -- --check
16
+ - uses : actions/checkout@v4
17
+ - run : rustup install stable --profile=minimal --components=rustfmt
18
+ - run : cargo fmt -- --check --color=always
22
19
test :
23
20
name : Test
24
21
runs-on : ubuntu-latest
25
22
env :
26
- CARGO_INCREMENTAL : 0
27
- CARGO_PROFILE_DEBUG_DEBUG : 0
28
23
CARGO_TARGET_DIR : target
29
24
RUSTDOCFLAGS : --deny warnings
30
25
RUSTFLAGS : --deny warnings
31
- RUST_BACKTRACE : 1
26
+ RUST_BACKTRACE : ' 1 '
32
27
strategy :
33
28
fail-fast : false
34
29
matrix :
35
30
toolchain :
36
31
- stable
37
32
- beta
38
33
- nightly
34
+ # The old toolchain is tested to detect accidental compatibility breakage, but we don't
35
+ # explicitly guarantee minimum toolchain version and this may increase at any time.
39
36
- ' 1.48.0'
40
37
target :
41
38
-
@@ -61,16 +58,13 @@ jobs:
61
58
- toolchain : ' 1.48.0'
62
59
minimum_rust : true
63
60
steps :
64
- - uses : actions/checkout@v2
65
- - name : Install Rust toolchain
66
- uses : actions-rs/toolchain@v1
61
+ - uses : actions/checkout@v4
62
+ - uses : dtolnay/rust-toolchain@21dc36fb71dd22e3317045c0c31a3f4249868b17
67
63
with :
68
64
toolchain : ${{ matrix.toolchain }}
69
- target : ${{ matrix.target }}
70
- profile : minimal
71
- override : true
65
+ targets : ${{ matrix.target }}
72
66
components : ${{ matrix.components }}
73
- - uses : Swatinem/rust-cache@v1
67
+ - uses : Swatinem/rust-cache@v2
74
68
with :
75
69
key : ${{ matrix.target }}
76
70
- name : Install `wasm-bindgen-test-runner`
@@ -89,45 +83,27 @@ jobs:
89
83
if : matrix.target != ''
90
84
- name : Clippy `oauth1-request`
91
85
if : contains(matrix.components, 'clippy')
92
- uses : actions-rs/cargo@v1
93
- with :
94
- command : clippy
95
- args : --verbose --tests --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
86
+ run : cargo clippy --verbose --tests --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
96
87
- name : Check docs of `oauth1-request`
97
88
if : ${{ !matrix.minimum_rust && matrix.features == 'js,derive' }}
98
- uses : actions-rs/cargo@v1
99
- with :
100
- command : doc
101
- args : --verbose --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}' --no-deps
89
+ run : cargo doc --verbose --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}' --no-deps
102
90
- name : Build `oauth1-request`
103
91
if : ${{ !matrix.minimum_rust }}
104
- uses : actions-rs/cargo@v1
105
- with :
106
- command : build
107
- args : --verbose --tests --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
92
+ run : cargo build --verbose --tests --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
108
93
- name : Check `oauth1-request`
109
94
if : matrix.minimum_rust
110
- uses : actions-rs/cargo@v1
111
- with :
112
- command : check
113
- # Cargo of toolchain v1.48.0 cannot parse the registry information because of the use of
114
- # the resovler v2 by some of its dependencies, even when none of the enabled crate
115
- # features depend on them. To work around this, we instead build `oauth1-request`
116
- # indirectly through `oauth1-request-test` crate, which depends on the crate but without
117
- # the crate features that causes the issue.
118
- args : --verbose --tests --manifest-path oauth1-request-test/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
119
- - name : Build `examples`
95
+ # Cargo of toolchain v1.48.0 cannot parse the registry information because of the use of the
96
+ # resovler v2 by some of its dependencies, even when none of the enabled crate features
97
+ # depend on them. To work around this, we instead build `oauth1-request` indirectly through
98
+ # `oauth1-request-test` crate, which depends on the crate but without the crate features
99
+ # that causes the issue.
100
+ run : cargo check --verbose --tests --manifest-path oauth1-request-test/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
101
+ - name : Check `examples`
120
102
if : ${{ !matrix.minimum_rust && matrix.target == '' }}
121
- uses : actions-rs/cargo@v1
122
- with :
123
- command : build
124
- args : --verbose --manifest-path examples/Cargo.toml
103
+ run : cargo check --verbose --manifest-path examples/Cargo.toml
125
104
- name : Test `oauth1-request`
126
105
if : ${{ !matrix.minimum_rust && matrix.target == '' }}
127
- uses : actions-rs/cargo@v1
128
- with :
129
- command : test
130
- args : --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
106
+ run : cargo test --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
131
107
derive-test :
132
108
name : Test `oauth1-request-derive`
133
109
runs-on : ubuntu-latest
@@ -143,24 +119,14 @@ jobs:
143
119
# Also, we don't want the workflow to break nightly :)
144
120
continue-on-error : ${{ matrix.toolchain != 'stable' }}
145
121
steps :
146
- - uses : actions/checkout@v2
122
+ - uses : actions/checkout@v4
147
123
- name : Install Rust toolchain
148
- uses : actions-rs/toolchain@v1
149
- with :
150
- toolchain : ${{ matrix.toolchain }}
151
- profile : minimal
152
- override : true
153
- - uses : Swatinem/rust-cache@v1
124
+ run : rustup install ${{ matrix.toolchain }} --profile=minimal && rustup default ${{ matrix.toolchain }}
125
+ - uses : Swatinem/rust-cache@v2
154
126
- name : Build `oauth1-request-derive`
155
- uses : actions-rs/cargo@v1
156
- with :
157
- command : build
158
- args : --verbose --tests --manifest-path oauth1-request-derive/Cargo.toml
127
+ run : cargo build --verbose --tests --manifest-path=oauth1-request-derive/Cargo.toml
159
128
- name : Test `oauth1-request-derive`
160
- uses : actions-rs/cargo@v1
161
- with :
162
- command : test
163
- args : --verbose --manifest-path oauth1-request-derive/Cargo.toml
129
+ run : cargo test --verbose --manifest-path oauth1-request-derive/Cargo.toml
164
130
credentials-msrv :
165
131
name : Build `oauth-credentials` on MSRV
166
132
runs-on : ubuntu-latest
@@ -177,15 +143,11 @@ jobs:
177
143
- toolchain : ' 1.36.0'
178
144
features : alloc
179
145
steps :
180
- - uses : actions/checkout@v2
146
+ - uses : actions/checkout@v4
181
147
- name : Install Rust toolchain
182
- uses : actions-rs/toolchain@v1
183
- with :
184
- toolchain : ${{ matrix.toolchain }}
185
- profile : minimal
186
- override : true
187
- - uses : Swatinem/rust-cache@v1
188
- - uses : actions/checkout@v2
148
+ run : rustup install ${{ matrix.toolchain }} --profile=minimal && rustup default ${{ matrix.toolchain }}
149
+ - uses : Swatinem/rust-cache@v2
150
+ - uses : actions/checkout@v4
189
151
with :
190
152
repository : rust-lang/crates.io-index
191
153
ref : 46a429eac9f70fd7281922780d7dd42e2fb7ab77
@@ -201,13 +163,10 @@ jobs:
201
163
registry = "file://$GITHUB_WORKSPACE/crates.io-index"
202
164
EOF
203
165
- name : Build `oauth-credentials`
204
- uses : actions-rs/cargo@v1
205
- with :
206
- command : build
207
- # Toolchains older than 1.8.0 cannot compile `oauth-credentials` directly
208
- # because the toolchains do not understand Cargo registry's information for `serde`, so we
209
- # use the same trick that we used for `oauth1-request`'s minimum tested toolchain.
210
- args : --verbose --manifest-path oauth-credentials-test/Cargo.toml --no-default-features --features=${{ matrix.features }}
166
+ # Toolchains older than 1.8.0 cannot compile `oauth-credentials` directly
167
+ # because the toolchains do not understand Cargo registry's information for `serde`, so we
168
+ # use the same trick that we used for `oauth1-request`'s minimum tested toolchain.
169
+ run : cargo build --verbose --manifest-path oauth-credentials-test/Cargo.toml --no-default-features --features=${{ matrix.features }}
211
170
credentials-test :
212
171
name : Test `oauth-credentials`
213
172
runs-on : ubuntu-latest
@@ -224,44 +183,25 @@ jobs:
224
183
- serde
225
184
- std
226
185
steps :
227
- - uses : actions/checkout@v2
186
+ - uses : actions/checkout@v4
228
187
- name : Install Rust toolchain
229
- uses : actions-rs/toolchain@v1
230
- with :
231
- toolchain : ${{ matrix.toolchain }}
232
- profile : minimal
233
- override : true
234
- - uses : Swatinem/rust-cache@v1
188
+ run : rustup install ${{ matrix.toolchain }} --profile=minimal && rustup default ${{ matrix.toolchain }}
189
+ - uses : Swatinem/rust-cache@v2
235
190
- name : Build `oauth-credentials`
236
- uses : actions-rs/cargo@v1
237
- with :
238
- command : build
239
- args : --verbose --manifest-path oauth-credentials/Cargo.toml --features=${{ matrix.features }}
191
+ run : cargo build --verbose --manifest-path oauth-credentials/Cargo.toml --features=${{ matrix.features }}
240
192
- name : Test `oauth-credentials`
241
- uses : actions-rs/cargo@v1
242
- with :
243
- command : test
244
- args : --verbose --manifest-path oauth-credentials/Cargo.toml --features=${{ matrix.features }}
193
+ run : cargo test --verbose --manifest-path oauth-credentials/Cargo.toml --features=${{ matrix.features }}
245
194
min-deps :
246
195
name : Check with `-Z minimal-versions`
247
196
runs-on : ubuntu-latest
248
197
steps :
249
- - uses : actions/checkout@v2
198
+ - uses : actions/checkout@v4
250
199
- name : Install Rust toolchain
251
- uses : actions-rs/toolchain@v1
252
- with :
253
- toolchain : stable
254
- profile : minimal
255
- - uses : Swatinem/rust-cache@v1
200
+ run : rustup install stable --profile=minimal && rustup default
201
+ - uses : Swatinem/rust-cache@v2
256
202
- name : Cargo update
257
- uses : actions-rs/cargo@v1
258
- with :
259
- command : update
260
- args : -Z minimal-versions
203
+ run : cargo update -Z minimal-versions
261
204
env :
262
- RUSTC_BOOTSTRAP : 1
205
+ RUSTC_BOOTSTRAP : ' 1 '
263
206
- name : Check
264
- uses : actions-rs/cargo@v1
265
- with :
266
- command : check
267
- args : --verbose --all-features
207
+ run : cargo check --verbose --all-features
0 commit comments