Skip to content

Commit

Permalink
ref: cleanup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
bidzyyys committed Sep 20, 2024
1 parent 2066af4 commit 99f6178
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 23 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/check-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ jobs:
with:
target: wasm32-unknown-unknown
components: rust-src
toolchain: nightly-2024-07-25
toolchain: nightly-2024-01-01

- uses: Swatinem/rust-cache@v2

- name: install cargo-stylus
run: cargo install [email protected].1
run: cargo install [email protected].3

- name: run wasm check
run: |
export NIGHTLY_TOOLCHAIN=${{steps.toolchain.outputs.name}}
./scripts/check-wasm.sh
run: ./scripts/check-wasm.sh
8 changes: 3 additions & 5 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:
with:
target: wasm32-unknown-unknown
components: rust-src
toolchain: nightly-2024-07-25
toolchain: nightly-2024-01-01

- uses: Swatinem/rust-cache@v2
with:
key: "e2e-tests"

- name: install cargo-stylus
run: cargo install [email protected].1
run: cargo install [email protected].3

- name: install solc
run: |
Expand All @@ -50,6 +50,4 @@ jobs:
- name: setup nitro node
run: ./scripts/nitro-testnode.sh -d -i
- name: run integration tests
run: |
export NIGHTLY_TOOLCHAIN=${{steps.toolchain.outputs.name}}
./scripts/e2e-tests.sh
run: ./scripts/e2e-tests.sh
6 changes: 2 additions & 4 deletions .github/workflows/gas-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
target: wasm32-unknown-unknown
components: rust-src
toolchain: nightly-2024-07-25
toolchain: nightly-2024-01-01

- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -40,6 +40,4 @@ jobs:
- name: setup nitro node
run: ./scripts/nitro-testnode.sh -d -i
- name: run benches
run: |
export NIGHTLY_TOOLCHAIN=${{steps.toolchain.outputs.name}}
./scripts/bench.sh
run: ./scripts/bench.sh
3 changes: 1 addition & 2 deletions scripts/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ MYDIR=$(realpath "$(dirname "$0")")
cd "$MYDIR"
cd ..

NIGHTLY_TOOLCHAIN=${NIGHTLY_TOOLCHAIN:-nightly}
cargo +"$NIGHTLY_TOOLCHAIN" build --release --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
cargo build --release --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort

export RPC_URL=http://localhost:8547
cargo run --release -p benches
Expand Down
4 changes: 1 addition & 3 deletions scripts/check-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ get_example_crate_names () {
find ./examples -maxdepth 2 -type f -name "Cargo.toml" | xargs grep 'name = ' | grep -oE '".*"' | tr -d "'\""
}

NIGHTLY_TOOLCHAIN=${NIGHTLY_TOOLCHAIN:-nightly}

cargo +"$NIGHTLY_TOOLCHAIN" build --release --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
cargo build --release --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort

for CRATE_NAME in $(get_example_crate_names)
do
Expand Down
5 changes: 2 additions & 3 deletions scripts/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ MYDIR=$(realpath "$(dirname "$0")")
cd "$MYDIR"
cd ..

NIGHTLY_TOOLCHAIN=${NIGHTLY_TOOLCHAIN:-nightly-2024-01-01}
cargo +"$NIGHTLY_TOOLCHAIN" build --release --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
cargo build --release --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort

export RPC_URL=http://localhost:8547
# We should use stable here once nitro-testnode is updated and the contracts fit
# the size limit. Work tracked [here](https://github.com/OpenZeppelin/rust-contracts-stylus/issues/87)
cargo +"$NIGHTLY_TOOLCHAIN" test --features std,e2e --test "*"
cargo test --features std,e2e --test "*"
2 changes: 1 addition & 1 deletion scripts/nitro-testnode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ then
git clone --recurse-submodules https://github.com/OffchainLabs/nitro-testnode.git
cd ./nitro-testnode || exit
# `release` branch.
git checkout 8cb6b84e31909157d431e7e4af9fb83799443e00 || exit
git checkout 148b8cb33fb085345d9abdf0ba57d3b67f63499d || exit

./test-node.bash --no-run --init || exit
fi
Expand Down

0 comments on commit 99f6178

Please sign in to comment.