Skip to content

Commit 6fb8a3f

Browse files
Fix }CI release workflows: correct working-directory and cache
1 parent 83b0fb7 commit 6fb8a3f

2 files changed

Lines changed: 29 additions & 10 deletions

File tree

.github/workflows/native.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,49 @@ jobs:
2323

2424
name: ${{ matrix.name }}
2525
runs-on: ${{ matrix.os }}
26-
defaults:
27-
run:
28-
working-directory: compiler
26+
permissions:
27+
contents: write
2928

3029
steps:
3130
- uses: actions/checkout@v5
3231

32+
- name: Cache Rust
33+
uses: Swatinem/rust-cache@v2
34+
with:
35+
workspaces: compiler
36+
3337
- uses: dtolnay/rust-toolchain@stable
3438
with:
3539
components: rust-src, clippy
3640

3741
- name: Install target
3842
run: rustup target add ${{ matrix.target }}
39-
40-
- uses: Swatinem/rust-cache@v2
43+
working-directory: compiler
4144

4245
- name: Build
4346
run: cargo build --release --target ${{ matrix.target }}
47+
working-directory: compiler
4448

4549
- name: Size
4650
run: ls -lh target/${{ matrix.target }}/release/${{ matrix.binary }}
4751
shell: bash
52+
working-directory: compiler
4853

4954
- name: Test
5055
run: cargo test
56+
working-directory: compiler
5157

5258
- name: Install CLI Tools
5359
run: cargo install cargo-shear cargo-bloat
60+
working-directory: compiler
5461

5562
- name: Unused Code
5663
run: cargo shear && cargo clippy --target ${{ matrix.target }}
64+
working-directory: compiler
5765

5866
- name: Bloat
5967
run: cargo bloat --release --target ${{ matrix.target }} --crates -n 7
68+
working-directory: compiler
6069

6170
- name: Upload Native Release
6271
uses: softprops/action-gh-release@v2

.github/workflows/wasm.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,43 @@ jobs:
55
build:
66
name: WebAssembly
77
runs-on: ubuntu-latest
8-
defaults:
9-
run:
10-
working-directory: compiler
8+
permissions:
9+
contents: write
1110

1211
steps:
1312
- uses: actions/checkout@v5
1413

15-
- uses: Swatinem/rust-cache@v2
14+
- name: Cache Rust
15+
uses: Swatinem/rust-cache@v2
16+
with:
17+
workspaces: compiler
1618

1719
- uses: dtolnay/rust-toolchain@stable
1820
with:
1921
components: clippy
2022

2123
- name: Install target
2224
run: rustup target add wasm32-unknown-unknown
25+
working-directory: compiler
2326

2427
- name: Install CLI Tools
2528
run: |
2629
cargo install cargo-shear
2730
sudo apt update
2831
sudo apt-get install -y binaryen
32+
working-directory: compiler
2933

3034
- name: Build
3135
run: cargo build --target wasm32-unknown-unknown --features wasm --lib --release
36+
working-directory: compiler
3237

3338
- name: Unused Code
3439
run: cargo shear && cargo clippy --lib --target wasm32-unknown-unknown --features wasm
40+
working-directory: compiler
3541

3642
- name: Size
3743
run: ls -lh target/wasm32-unknown-unknown/release/compiler_lib.wasm
44+
working-directory: compiler
3845

3946
- name: Optimize
4047
run: |
@@ -44,13 +51,16 @@ jobs:
4451
--enable-sign-ext \
4552
-o target/wasm32-unknown-unknown/release/compiler_lib.wasm \
4653
target/wasm32-unknown-unknown/release/compiler_lib.wasm
54+
working-directory: compiler
4755

4856
- name: Size (optimized)
4957
run: ls -lh target/wasm32-unknown-unknown/release/compiler_lib.wasm
58+
working-directory: compiler
5059

5160
- name: Test
5261
run: cargo test --features wasm-tests
53-
62+
working-directory: compiler
63+
5464
- name: Upload WASM Release
5565
uses: softprops/action-gh-release@v2
5666
if: startsWith(github.ref, 'refs/tags/')

0 commit comments

Comments
 (0)