11name : CI
22on :
3- push :
3+ pull_request :
4+ push : # bors
45 branches :
56 - staging
67 - trying
78
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+
816jobs :
9- tests :
10- name : Tests
17+ cargo-test :
18+ name : Tests (beta)
19+ if : ${{ github.event.pusher.name == 'bors[bot]' }}
1120 runs-on : ubuntu-latest
12- env :
13- RUSTFLAGS : -D warnings
14- CARGO_INCREMENTAL : 0
1521 steps :
1622
1723 - name : Checkout repository
18- uses : actions/checkout@v1
24+ uses : actions/checkout@v2
1925
20- - name : Install toolchain
26+ - name : Install beta toolchain
2127 uses : actions-rs/toolchain@v1
2228 with :
2329 toolchain : beta
2430 profile : minimal
2531 override : true
2632
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
3235
3336 - name : Compile
3437 uses : actions-rs/cargo@v1
3538 with :
3639 command : test
3740 args : --all --all-targets --examples --no-run
3841
39- - name : Test
42+ - name : Run tests
4043 uses : actions-rs/cargo@v1
4144 with :
4245 command : test
4346 args : --all --all-targets --examples
4447
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)
5350 runs-on : ubuntu-latest
54- env :
55- RUSTFLAGS : -D warnings
56- CARGO_INCREMENTAL : 0
5751 steps :
5852
5953 - name : Checkout repository
60- uses : actions/checkout@v1
54+ uses : actions/checkout@v2
6155
62- - name : Install nightly toolchain
56+ - name : Install arbitrary nightly toolchain
6357 uses : actions-rs/toolchain@v1
6458 with :
6559 toolchain : nightly-2020-01-01
6660 profile : minimal
6761
68- - name : Install minimum supported stable toolchain
62+ - name : Install msrv toolchain
6963 uses : actions-rs/toolchain@v1
7064 with :
7165 toolchain : 1.41.0
7266 profile : minimal
7367 override : true
7468
75- - name : Generate lockfile
69+ - name : Generate minimal-versions lockfile
7670 uses : actions-rs/cargo@v1
7771 with :
7872 command : +nightly-2020-01-01
7973 args : -Z minimal-versions generate-lockfile
8074
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
8677
8778 - name : Compile
8879 uses : actions-rs/cargo@v1
8980 with :
9081 command : test
9182 args : --locked --all --all-targets --examples --no-run
9283
93- - name : Test
84+ - name : Run tests
9485 uses : actions-rs/cargo@v1
9586 with :
9687 command : test
9788 args : --locked --all --all-targets --examples
9889
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
10792 runs-on : ubuntu-latest
108- env :
109- RUSTFLAGS : -D warnings
110- CARGO_INCREMENTAL : 0
11193 steps :
11294
11395 - name : Checkout repository
114- uses : actions/checkout@v1
96+ uses : actions/checkout@v2
11597
116- - name : Install toolchain
98+ - name : Install beta toolchain
11799 uses : actions-rs/toolchain@v1
118100 with :
119101 profile : minimal
@@ -127,18 +109,15 @@ jobs:
127109 command : fmt
128110 args : --all -- --check
129111
130- check :
131- name : Clippy
112+ cargo-clippy :
113+ name : Lints
132114 runs-on : ubuntu-latest
133- env :
134- RUSTFLAGS : -D warnings
135- CARGO_INCREMENTAL : 0
136115 steps :
137116
138117 - name : Checkout repository
139- uses : actions/checkout@v1
118+ uses : actions/checkout@v2
140119
141- - name : Install toolchain
120+ - name : Install beta toolchain
142121 uses : actions-rs/toolchain@v1
143122 with :
144123 profile : minimal
@@ -147,67 +126,39 @@ jobs:
147126 components : clippy
148127
149128 - name : Check style
150- uses : actions-rs/clippy-check @v1
129+ uses : actions-rs/cargo @v1
151130 with :
152- token : ${{ secrets.GITHUB_TOKEN }}
131+ command : clippy
153132 args : --all --all-targets
154133
155- miri :
134+ cargo- miri :
156135 name : Miri
136+ if : ${{ github.event.pusher.name == 'bors[bot]' }}
157137 runs-on : ubuntu-latest
158- env :
159- RUSTFLAGS : -D warnings
160- CARGO_INCREMENTAL : 0
161138 steps :
162139
163140 - name : Checkout repository
164- uses : actions/checkout@v1
141+ uses : actions/checkout@v2
165142
166- - name : Install toolchain
143+ - name : Install nightly toolchain
167144 uses : actions-rs/toolchain@v1
168145 with :
169146 profile : minimal
170147 toolchain : nightly
171148 override : true
172149 components : miri
173150
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
179153
180154 - name : Miri setup
181155 uses : actions-rs/cargo@v1
182156 with :
183157 command : miri
184158 args : setup
185159
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