Skip to content

Commit ba383b4

Browse files
authored
performance(ci): Separating codegen from other tests for better caching. (#8439)
1 parent fcac579 commit ba383b4

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ jobs:
2020
- run: |
2121
cd ensure-no_std && cargo build
2222
23+
syntax-codegen-test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v5
27+
- uses: dtolnay/rust-toolchain@master
28+
with:
29+
components: rustfmt
30+
toolchain: nightly-2025-08-05
31+
- uses: dtolnay/rust-toolchain@stable
32+
- uses: Swatinem/rust-cache@v2
33+
- run: cargo test --profile=ci-dev -p cairo-lang-syntax-codegen
34+
2335
parallel-tests:
2436
runs-on: ubuntu-latest
2537
strategy:
@@ -56,7 +68,6 @@ jobs:
5668
- cairo-lang-starknet-classes
5769
- cairo-lang-starknet
5870
- cairo-lang-syntax
59-
- cairo-lang-syntax-codegen
6071
- cairo-lang-test-plugin
6172
- cairo-lang-test-runner
6273
- cairo-lang-test-utils
@@ -65,23 +76,17 @@ jobs:
6576
- tests
6677
steps:
6778
- uses: actions/checkout@v5
68-
- uses: dtolnay/rust-toolchain@master
69-
with:
70-
components: rustfmt
71-
toolchain: nightly-2025-08-05
7279
- uses: dtolnay/rust-toolchain@stable
7380
- uses: Swatinem/rust-cache@v2
7481
with:
7582
# Allow only the heavy 'tests' leg to upload the cache; all legs still restore it.
7683
save-if: ${{ matrix.args == 'tests' }}
77-
- name: Install nextest
78-
uses: taiki-e/install-action@nextest
7984
# Validates that the number of commands in the matrix is equal to the number of crates in the
80-
# workspace + 2 (for the crates which have multiple commands)
85+
# workspace + 2 (for the crates which have multiple commands) - 1 (for the syntax-codegen-test)
8186
- run: |
8287
CRATES_COUNT=$(find {crates/*,tests}/Cargo.toml | wc -l)
8388
COMMANDS_COUNT=${{ strategy.job-total }}
84-
if [ $((CRATES_COUNT + 2)) -ne $COMMANDS_COUNT ]; then
89+
if [ $((CRATES_COUNT + 2 - 1)) -ne $COMMANDS_COUNT ]; then
8590
echo "CRATES_COUNT: $CRATES_COUNT"
8691
echo "COMMANDS_COUNT: $COMMANDS_COUNT"
8792
echo "The number of commands in the matrix is not equal to the number of crates in the workspace + 1"
@@ -91,12 +96,12 @@ jobs:
9196
cargo test --profile=ci-dev -p ${{ matrix.args }}
9297
test:
9398
if: ${{ always() }}
94-
needs: parallel-tests
99+
needs: [parallel-tests, syntax-codegen-test]
95100
runs-on: ubuntu-latest
96101
steps:
97-
- if: needs.parallel-tests.result == 'success'
102+
- if: needs.parallel-tests.result == 'success' && needs.syntax-codegen-test.result == 'success'
98103
run: exit 0
99-
- if: needs.parallel-tests.result != 'success'
104+
- if: needs.parallel-tests.result != 'success' || needs.syntax-codegen-test.result != 'success'
100105
run: exit 1
101106
rustfmt:
102107
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)