Skip to content

Commit a1bc159

Browse files
bors[bot]CAD97
andauthored
Merge #73
73: Update CI configuration r=CAD97 a=CAD97 Co-authored-by: CAD97 <cad97@cad97.com>
2 parents 5b296c5 + 20ab379 commit a1bc159

File tree

4 files changed

+61
-205
lines changed

4 files changed

+61
-205
lines changed

.github/workflows/ci.yaml

Lines changed: 47 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,101 @@
11
name: CI
22
on:
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+
816
jobs:
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

.github/workflows/pr.yaml

Lines changed: 0 additions & 94 deletions
This file was deleted.

.github/workflows/rustdoc.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,32 @@ on:
55
- master
66

77
jobs:
8-
rustdoc:
8+
cargo-doc:
99
runs-on: ubuntu-latest
1010
env:
1111
CARGO_INCREMENTAL: 0
1212

1313
steps:
1414
- name: Checkout repository
15-
uses: actions/checkout@v1
15+
uses: actions/checkout@v2
1616

17-
- name: Install Rust toolchain
17+
- name: Install beta toolchain
1818
uses: actions-rs/toolchain@v1
1919
with:
2020
toolchain: beta
2121
profile: minimal
2222
override: true
2323

24-
- name: Build Documentation
24+
- name: Build docs
2525
uses: actions-rs/cargo@v1
2626
with:
2727
command: doc
2828
args: --no-deps
2929

30-
- name: Deploy Docs
31-
uses: peaceiris/actions-gh-pages@v2.6.0-rc0
32-
env:
33-
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
34-
PUBLISH_BRANCH: gh-pages
35-
PUBLISH_DIR: ./target/doc
30+
- name: Deploy docs
31+
uses: peaceiris/actions-gh-pages@v3
3632
with:
37-
forceOrphan: true
33+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
34+
github_token: ${{ github.token }}
35+
public_dir: ./target/doc
36+
force_orphan: true

0 commit comments

Comments
 (0)