Skip to content

Commit be18b13

Browse files
authored
CI overhaul (#156)
* remove nightly tests * nuke build job * cargo check MSRV * pin to nightly-2022-12-01 * cache builds
1 parent e7e6199 commit be18b13

File tree

1 file changed

+67
-94
lines changed

1 file changed

+67
-94
lines changed

.github/workflows/CI.yml

Lines changed: 67 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@ on:
77

88
env:
99
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
1015

1116
jobs:
1217
ci-pass:
1318
name: CI is green
1419
runs-on: ubuntu-latest
1520
needs:
1621
- style
17-
- build
22+
- lint
23+
- msrv
1824
- test
1925
- doc
20-
- lint
2126
- fuzz
2227
steps:
2328
- run: exit 0
@@ -26,166 +31,134 @@ jobs:
2631
name: Check Style
2732
runs-on: ubuntu-latest
2833
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 }}
3336
uses: actions-rs/toolchain@v1
3437
with:
3538
profile: minimal
36-
toolchain: stable
39+
toolchain: ${{ env.toolchain_style }}
3740
override: true
3841
components: rustfmt
39-
40-
- name: cargo fmt --check
42+
- uses: Swatinem/rust-cache@v2
43+
- name: cargo fmt --all -- --check
4144
uses: actions-rs/cargo@v1
4245
with:
4346
command: fmt
4447
args: --all -- --check
4548

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
5551
runs-on: ubuntu-latest
5652
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 }}
6155
uses: actions-rs/toolchain@v1
6256
with:
6357
profile: minimal
64-
toolchain: ${{ matrix.rust }}
58+
toolchain: ${{ env.toolchain_lint }}
6559
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
6666

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
6881
uses: actions-rs/cargo@v1
6982
with:
70-
command: build
71-
args: -p h3
83+
command: check
84+
args: --workspace
7285

7386
test:
74-
name: Test ${{ matrix.rust }}
87+
name: Test ${{ matrix.toolchain }} ${{ matrix.os }}
7588
needs: [style]
7689
strategy:
7790
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 }}
8694
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 }}
9197
uses: actions-rs/toolchain@v1
9298
with:
9399
profile: minimal
94-
toolchain: ${{ matrix.rust }}
100+
toolchain: ${{ matrix.toolchain }}
95101
override: true
96-
97-
- name: Test
102+
- uses: Swatinem/rust-cache@v2
103+
- name: cargo test
98104
uses: actions-rs/cargo@v1
99105
with:
100106
command: test
101-
102107
- name: h3Spec
103108
run: ./ci/h3spec.sh
104-
if: matrix.rust == 'stable'
109+
if: matrix.toolchain == 'stable'
105110

106111
doc:
107112
name: Build docs
108-
needs: [style, test]
113+
needs: [test]
109114
runs-on: ubuntu-latest
110115
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 }}
115118
uses: actions-rs/toolchain@v1
116119
with:
117120
profile: minimal
118-
toolchain: nightly
121+
toolchain: ${{ env.toolchain_doc }}
119122
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
122125
uses: actions-rs/cargo@v1
123126
with:
124127
command: rustdoc
125128
args: -p h3 -- -D intra-doc-link-resolution-failure
126129

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-
147130
fuzz:
148131
name: Fuzz test
149-
needs: [style, test]
150-
strategy:
151-
matrix:
152-
rust:
153-
- nightly
154-
132+
needs: [test]
155133
runs-on: ubuntu-latest
156-
157134
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 }}
162137
uses: actions-rs/toolchain@v1
163138
with:
164139
profile: minimal
165-
toolchain: ${{ matrix.rust }}
140+
toolchain: ${{ env.toolchain_fuzz }}
166141
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
170145
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
175148
uses: actions-rs/cargo@v1
176149
with:
177-
command: +nightly
178-
args: fuzz run fuzz_varint -- -runs=1
150+
command: fuzz
151+
args: run fuzz_varint -- -runs=1
179152

180153
compliance:
181154
name: Compliance report
155+
needs: [test]
182156
runs-on: ubuntu-latest
183157
steps:
184158
- uses: actions/checkout@v3
185159
with:
186160
persist-credentials: false
187161
fetch-depth: 0
188-
189162
- name: Generate compliance report
190163
uses: ./.github/actions/compliance
191164
with:

0 commit comments

Comments
 (0)