Skip to content

Commit

Permalink
wasm-opt - set to basic flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mrLSD committed Sep 7, 2023
1 parent 11a2a62 commit b723c31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@ jobs:
run: cargo make test-contracts
- name: Build mainnet test WASM
run: cargo make --profile mainnet build-test
- name: WASM opt mainnet
run: cargo make --profile mainnet wasm-opt-test
- name: List mainnet WASM directory and root directory
run: ls -la target/wasm32-unknown-unknown/release && ls -la
- name: Test mainnet
run: cargo make --profile mainnet test-workspace
- name: Build testnet test WASM
run: cargo make --profile testnet build-test
- name: WASM opt testnet
run: cargo make --profile testnet wasm-opt-test
- name: List testnet WASM directory and root directory
run: ls -la target/wasm32-unknown-unknown/release && ls -la
- name: Test testnet
Expand Down
11 changes: 6 additions & 5 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ dependencies = [
"build-engine",
"make-bin-directory",
"copy-engine-build",
"wasm-opt",
"post-engine-build-env",
]

Expand All @@ -267,6 +268,7 @@ dependencies = [
"build-engine",
"make-bin-directory",
"copy-engine-build",
"wasm-opt",
"post-engine-build-env",
]

Expand All @@ -285,13 +287,13 @@ env = { "RUSTFLAGS" = "${RUSTC_FLAGS_BUILD}", "CARGO_FEATURES" = "${CARGO_FEATUR
category = "Build"
run_task = "build-engine-flow"

[tasks.wasm-opt-test]
[tasks.wasm-opt]
condition = { profiles = ["mainnet", "testnet", "custom"] }
category = "Build"
script = '''
filesize_before=$(wc -c bin/${WASM_FILE_TEST} | awk '{print $1}')
wasm-opt -O4 bin/${WASM_FILE_TEST} -o bin/${WASM_FILE_TEST} --strip-debug --vacuum
filesize_after=$(wc -c bin/${WASM_FILE_TEST} | awk '{print $1}')
filesize_before=$(wc -c bin/${WASM_FILE} | awk '{print $1}')
wasm-opt -O4 bin/${WASM_FILE} -o bin/${WASM_FILE} --strip-debug --vacuum
filesize_after=$(wc -c bin/${WASM_FILE} | awk '{print $1}')
echo "File size before: [$filesize_before] and after: [$filesize_after]"
'''

Expand Down Expand Up @@ -361,7 +363,6 @@ args = [
category = "Test"
dependencies = [
"build-test",
"wasm-opt-test",
"test-contracts",
"test-workspace",
"bench-modexp",
Expand Down

0 comments on commit b723c31

Please sign in to comment.