Skip to content

Commit c65f933

Browse files
authored
ci: split jobs so they run in parallel (#146)
This makes it easier to see which job failed at a glance
1 parent c9f7d6d commit c65f933

File tree

1 file changed

+30
-32
lines changed

1 file changed

+30
-32
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,42 @@ on:
1010

1111
jobs:
1212
build:
13-
name: Build & Test
14-
runs-on: ubuntu-22.04
13+
name: Build
14+
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout the repository
1717
uses: actions/checkout@v4
18-
1918
- name: Install Rust toolchain
2019
uses: dtolnay/rust-toolchain@stable
21-
with:
22-
targets: x86_64-unknown-linux-gnu
23-
components: rustfmt, clippy
24-
2520
- name: Cache Cargo dependencies
26-
uses: actions/cache@v4
27-
with:
28-
path: |
29-
~/.cargo/bin/
30-
~/.cargo/registry/index/
31-
~/.cargo/registry/cache/
32-
~/.cargo/git/db/
33-
target/
34-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
35-
36-
- name: Check the formatting
37-
uses: actions-rs/cargo@v1
38-
with:
39-
command: fmt
40-
args: -- --check --verbose
41-
21+
uses: Swatinem/rust-cache@v2
4222
- name: Build the project
43-
uses: actions-rs/cargo@v1
23+
run: cargo check --locked --verbose
24+
lint-formatting:
25+
name: Lint Formatting
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout the repository
29+
uses: actions/checkout@v4
30+
- name: Install Rust toolchain
31+
uses: dtolnay/rust-toolchain@stable
4432
with:
45-
command: check
46-
args: --locked --verbose
47-
48-
- name: Check the lints
49-
uses: actions-rs/cargo@v1
33+
components: rustfmt
34+
- name: Cache Cargo dependencies
35+
uses: Swatinem/rust-cache@v2
36+
- name: Check formatting
37+
run: cargo fmt --check
38+
lint-clippy:
39+
name: Lint Clippy
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout the repository
43+
uses: actions/checkout@v4
44+
- name: Install Rust toolchain
45+
uses: dtolnay/rust-toolchain@stable
5046
with:
51-
command: clippy
52-
args: --tests --verbose -- -D warnings
53-
47+
components: clippy
48+
- name: Cache Cargo dependencies
49+
uses: Swatinem/rust-cache@v2
50+
- name: Check Clippy lints
51+
run: cargo clippy --tests -- -D warnings

0 commit comments

Comments
 (0)