Skip to content

Commit 44f4b5f

Browse files
committed
ci: split into two jobs (to avoid rebuild on fail)
1 parent b526efd commit 44f4b5f

File tree

1 file changed

+57
-11
lines changed

1 file changed

+57
-11
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ env:
99
CARGO_TERM_COLOR: always
1010

1111
jobs:
12-
build_and_test:
13-
name: Rust project
12+
build:
13+
name: Build
1414
runs-on: ubuntu-22.04
1515
strategy:
16-
matrix:
17-
toolchain:
18-
- stable
1916
fail-fast: false
2017

2118
steps:
@@ -57,10 +54,59 @@ jobs:
5754
- name: Build
5855
run: pixi run build
5956

60-
- name: Install `cargo` tools to do more testing
61-
uses: taiki-e/install-action@v2
62-
with:
63-
tool: cargo-deny,cargo-machete,cargo-nextest,cargo-rdme
57+
check:
58+
name: Run checks
59+
runs-on: ubuntu-22.04
60+
needs: build
61+
strategy:
62+
fail-fast: false
63+
steps:
64+
- uses: actions/checkout@v3
65+
66+
- name: Install an assembler
67+
run: sudo apt-get install yasm -y
68+
69+
- uses: prefix-dev/[email protected]
70+
with:
71+
pixi-version: v0.44.0
72+
cache: true
73+
74+
- uses: actions/cache@v4
75+
name: Restore cargo registry
76+
with:
77+
path: ~/.cargo/registry
78+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
79+
restore-keys: |
80+
${{ runner.os }}-cargo-registry-
81+
82+
- uses: actions/cache@v4
83+
name: Restore cargo index
84+
with:
85+
path: ~/.cargo/git
86+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
87+
restore-keys: |
88+
${{ runner.os }}-cargo-index-
89+
90+
- uses: actions/cache@v4
91+
name: Restore cargo build outputs
92+
with:
93+
path: target
94+
key: ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
95+
restore-keys: |
96+
${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-
97+
98+
- uses: actions/cache@v4
99+
name: Restore cargo bin
100+
with:
101+
path: ~/.cargo/bin
102+
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }}
103+
restore-keys: |
104+
${{ runner.os }}-cargo-bin-
105+
106+
- name: Install `cargo` tools to do more testing
107+
uses: taiki-e/install-action@v2
108+
with:
109+
tool: cargo-deny,cargo-machete,cargo-nextest,cargo-rdme
64110

65-
- name: Run checks
66-
run: pixi run check
111+
- name: Run checks
112+
run: pixi run check

0 commit comments

Comments
 (0)