Skip to content

Commit 307b346

Browse files
committed
try fixing size-cmp workflow
1 parent 1a00f3d commit 307b346

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.github/workflows/size-cmp.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ jobs:
3030
uses: actions/checkout@v4
3131
if: ${{ matrix.target == 'pr' }}
3232

33-
- name: Write Optimisation Flags
34-
run: |
35-
echo 'build-std = ["std", "panic_abort"]' >> .cargo/config.toml
36-
echo 'build-std-features = ["panic_immediate_abort"]' >> .cargo/config.toml
37-
echo '[build]' >> .cargo/config.toml
38-
echo 'rustflags = ["-Cpanic=abort"]' >> .cargo/config.toml
39-
4033
- name: Setup toolchain
4134
uses: dtolnay/rust-toolchain@master
4235
with:
@@ -47,15 +40,31 @@ jobs:
4740
- name: Restore Rust cache for master
4841
uses: Swatinem/rust-cache@v2
4942
with:
50-
shared-key: size-compare
43+
key: size-compare-${{ matrix.target }}
5144

5245
- name: Setup Trunk
5346
uses: jetli/trunk-action@v0.5.1
5447
with:
5548
version: "latest"
5649

50+
- name: Build examples tool
51+
run: cargo build --release -p build-examples --bin build-examples
52+
53+
- name: Clean build artifacts to avoid conflicts
54+
run: |
55+
rm -rf target/wasm32-unknown-unknown
56+
rm -rf target/release/deps
57+
rm -rf target/release/build
58+
59+
- name: Write Optimisation Flags
60+
run: |
61+
echo 'build-std = ["std", "panic_abort"]' >> .cargo/config.toml
62+
echo 'build-std-features = ["panic_immediate_abort"]' >> .cargo/config.toml
63+
echo '[build]' >> .cargo/config.toml
64+
echo 'rustflags = ["-Cpanic=abort"]' >> .cargo/config.toml
65+
5766
- name: Build examples
58-
run: cargo run -p build-examples --bin build-examples
67+
run: ./target/release/build-examples
5968

6069
- name: Collect size information
6170
run: python3 ci/collect_sizes.py

0 commit comments

Comments
 (0)