File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,36 +12,41 @@ jobs:
1212 steps :
1313 - uses : actions/checkout@v5
1414
15+ - uses : Swatinem/rust-cache@v2
16+
1517 - uses : dtolnay/rust-toolchain@stable
1618 with :
1719 components : clippy
1820
1921 - name : Install target
2022 run : rustup target add wasm32-unknown-unknown
2123
22- - uses : Swatinem/rust-cache@v2
24+ - name : Install CLI Tools
25+ run : |
26+ cargo install cargo-shear
27+ sudo apt update
28+ sudo apt-get install -y binaryen
2329
2430 - name : Build
2531 run : cargo build --target wasm32-unknown-unknown --features wasm --lib --release
2632
27- - name : Install CLI Tools
28- run : cargo install cargo-shear cargo-bloat
29-
3033 - name : Unused Code
3134 run : cargo shear && cargo clippy --lib --target wasm32-unknown-unknown --features wasm
3235
36+ - name : Optimize
37+ run : |
38+ wasm-opt -Oz --converge --strip-debug \
39+ --enable-bulk-memory \
40+ --enable-nontrapping-float-to-int \
41+ -o target/wasm32-unknown-unknown/release/compiler_lib.wasm \
42+ target/wasm32-unknown-unknown/release/compiler_lib.wasm
43+
3344 - name : Test
3445 run : cargo test --features wasm-tests
3546
36- - name : Install WASM Tools
37- run : cargo install twiggy
38-
3947 - name : Size
4048 run : ls -lh target/wasm32-unknown-unknown/release/compiler_lib.wasm
41-
42- - name : Bloat
43- run : twiggy top target/wasm32-unknown-unknown/release/compiler_lib.wasm -n 10
44-
49+
4550 - uses : softprops/action-gh-release@v2
4651 if : startsWith(github.ref, 'refs/tags/')
4752 with :
You can’t perform that action at this time.
0 commit comments