1
1
name : CI
2
2
on :
3
- push :
3
+ pull_request :
4
+ push : # bors
4
5
branches :
5
6
- staging
6
7
- trying
7
8
9
+ env :
10
+ CI : 1
11
+ CARGO_INCREMENTAL : 0
12
+ CARGO_PROFILE_DEV_DEBUG : false
13
+ CARGO_PROFILE_RELEASE_DEBUG : false
14
+ RUSTFLAGS : -D warnings -W unreachable-pub
15
+
8
16
jobs :
9
- tests :
10
- name : Tests
17
+ cargo-test :
18
+ name : Tests (beta)
19
+ if : ${{ github.event.pusher.name == 'bors[bot]' }}
11
20
runs-on : ubuntu-latest
12
- env :
13
- RUSTFLAGS : -D warnings
14
- CARGO_INCREMENTAL : 0
15
21
steps :
16
22
17
23
- name : Checkout repository
18
- uses : actions/checkout@v1
24
+ uses : actions/checkout@v2
19
25
20
- - name : Install toolchain
26
+ - name : Install beta toolchain
21
27
uses : actions-rs/toolchain@v1
22
28
with :
23
29
toolchain : beta
24
30
profile : minimal
25
31
override : true
26
32
27
- - name : Cargo target cache
28
- uses : actions/cache@v1
29
- with :
30
- path : target
31
- key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
33
+ - name : Enable caching
34
+ uses : Swatinem/rust-cache@v1.3.0
32
35
33
36
- name : Compile
34
37
uses : actions-rs/cargo@v1
35
38
with :
36
39
command : test
37
40
args : --all --all-targets --examples --no-run
38
41
39
- - name : Test
42
+ - name : Run tests
40
43
uses : actions-rs/cargo@v1
41
44
with :
42
45
command : test
43
46
args : --all --all-targets --examples
44
47
45
- - name : Prepare build directory for cache
46
- run : |
47
- find ./target/debug -maxdepth 1 -type f -delete \
48
- && rm -fr ./target/debug/{deps,.fingerprint}/{*erasable*,*ptr-union*,*rc-borrow*,*rc-box*,*slice-dst*} \
49
- && rm -f ./target/.rustc_info.json
50
-
51
- msrv-tests :
52
- name : MSRV Tests
48
+ cargo-test-msrv :
49
+ name : Tests (1.41.0)
53
50
runs-on : ubuntu-latest
54
- env :
55
- RUSTFLAGS : -D warnings
56
- CARGO_INCREMENTAL : 0
57
51
steps :
58
52
59
53
- name : Checkout repository
60
- uses : actions/checkout@v1
54
+ uses : actions/checkout@v2
61
55
62
- - name : Install nightly toolchain
56
+ - name : Install arbitrary nightly toolchain
63
57
uses : actions-rs/toolchain@v1
64
58
with :
65
59
toolchain : nightly-2020-01-01
66
60
profile : minimal
67
61
68
- - name : Install minimum supported stable toolchain
62
+ - name : Install msrv toolchain
69
63
uses : actions-rs/toolchain@v1
70
64
with :
71
65
toolchain : 1.41.0
72
66
profile : minimal
73
67
override : true
74
68
75
- - name : Generate lockfile
69
+ - name : Generate minimal-versions lockfile
76
70
uses : actions-rs/cargo@v1
77
71
with :
78
72
command : +nightly-2020-01-01
79
73
args : -Z minimal-versions generate-lockfile
80
74
81
- - name : Cargo target cache
82
- uses : actions/cache@v1
83
- with :
84
- path : target
85
- key : ${{ runner.os }}-cargo-msrv-target-${{ hashFiles('**/Cargo.lock') }}
75
+ - name : Enable caching
76
+ uses : Swatinem/rust-cache@v1.3.0
86
77
87
78
- name : Compile
88
79
uses : actions-rs/cargo@v1
89
80
with :
90
81
command : test
91
82
args : --locked --all --all-targets --examples --no-run
92
83
93
- - name : Test
84
+ - name : Run tests
94
85
uses : actions-rs/cargo@v1
95
86
with :
96
87
command : test
97
88
args : --locked --all --all-targets --examples
98
89
99
- - name : Prepare build directory for cache
100
- run : |
101
- find ./target/debug -maxdepth 1 -type f -delete \
102
- && rm -fr ./target/debug/{deps,.fingerprint}/{*erasable*,*ptr-union*,*rc-borrow*,*rc-box*,*slice-dst*} \
103
- && rm -f ./target/.rustc_info.json
104
-
105
- fmt :
106
- name : Rustfmt
90
+ cargo-fmt :
91
+ name : Formatting
107
92
runs-on : ubuntu-latest
108
- env :
109
- RUSTFLAGS : -D warnings
110
- CARGO_INCREMENTAL : 0
111
93
steps :
112
94
113
95
- name : Checkout repository
114
- uses : actions/checkout@v1
96
+ uses : actions/checkout@v2
115
97
116
- - name : Install toolchain
98
+ - name : Install beta toolchain
117
99
uses : actions-rs/toolchain@v1
118
100
with :
119
101
profile : minimal
@@ -127,18 +109,15 @@ jobs:
127
109
command : fmt
128
110
args : --all -- --check
129
111
130
- check :
131
- name : Clippy
112
+ cargo-clippy :
113
+ name : Lints
132
114
runs-on : ubuntu-latest
133
- env :
134
- RUSTFLAGS : -D warnings
135
- CARGO_INCREMENTAL : 0
136
115
steps :
137
116
138
117
- name : Checkout repository
139
- uses : actions/checkout@v1
118
+ uses : actions/checkout@v2
140
119
141
- - name : Install toolchain
120
+ - name : Install beta toolchain
142
121
uses : actions-rs/toolchain@v1
143
122
with :
144
123
profile : minimal
@@ -147,67 +126,39 @@ jobs:
147
126
components : clippy
148
127
149
128
- name : Check style
150
- uses : actions-rs/clippy-check @v1
129
+ uses : actions-rs/cargo @v1
151
130
with :
152
- token : ${{ secrets.GITHUB_TOKEN }}
131
+ command : clippy
153
132
args : --all --all-targets
154
133
155
- miri :
134
+ cargo- miri :
156
135
name : Miri
136
+ if : ${{ github.event.pusher.name == 'bors[bot]' }}
157
137
runs-on : ubuntu-latest
158
- env :
159
- RUSTFLAGS : -D warnings
160
- CARGO_INCREMENTAL : 0
161
138
steps :
162
139
163
140
- name : Checkout repository
164
- uses : actions/checkout@v1
141
+ uses : actions/checkout@v2
165
142
166
- - name : Install toolchain
143
+ - name : Install nightly toolchain
167
144
uses : actions-rs/toolchain@v1
168
145
with :
169
146
profile : minimal
170
147
toolchain : nightly
171
148
override : true
172
149
components : miri
173
150
174
- - name : Cargo target cache
175
- uses : actions/cache@v1
176
- with :
177
- path : target
178
- key : ${{ runner.os }}-cargo-miri-target-${{ hashFiles('**/Cargo.lock') }}
151
+ - name : Enable caching
152
+ uses : Swatinem/rust-cache@v1.3.0
179
153
180
154
- name : Miri setup
181
155
uses : actions-rs/cargo@v1
182
156
with :
183
157
command : miri
184
158
args : setup
185
159
186
- # cargo-miri does not support workspaces yet [rust-lang/miri#1001]
187
- # so run `cargo miri test` in each crate directory manually.
188
- # We don't seem to be able to change the working directory of actions-rc/cargo.
189
- - name : Miri test erasable
190
- working-directory : ./crates/erasable
191
- run : cargo miri test --all-features
192
-
193
- - name : Miri test ptr-union
194
- working-directory : ./crates/ptr-union
195
- run : cargo miri test --all-features
196
-
197
- - name : Miri test rc-borrow
198
- working-directory : ./crates/rc-borrow
199
- run : cargo miri test --all-features
200
-
201
- - name : Miri test rc-box
202
- working-directory : ./crates/rc-box
203
- run : cargo miri test --all-features
204
-
205
- - name : Miri test slice-dst
206
- working-directory : ./crates/slice-dst
207
- run : cargo miri test --all-features
208
-
209
- - name : Prepare build directory for cache
210
- run : |
211
- find ./target/debug -maxdepth 1 -type f -delete \
212
- && rm -fr ./target/debug/{deps,.fingerprint}/{*erasable*,*ptr-union*,*rc-borrow*,*rc-box*,*slice-dst*} \
213
- && rm -f ./target/.rustc_info.json
160
+ - name : Miri test
161
+ uses : actions-rs/cargo@v1
162
+ with :
163
+ command : miri
164
+ args : test --workspace --all-features
0 commit comments