Skip to content

feat: local integration tests #13

feat: local integration tests

feat: local integration tests #13

Workflow file for this run

name: integration
# This is an integration test workflow that:
# - spins local nitro node
# - deploys and check every contract at `./examples` directory
# - runs integration test suite against all contracts deployed locally
permissions:
contents: read
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
integration:
name: integration testing suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: cache cargo-stylus
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/.crates.toml
key: ${{ runner.os }}[email protected]
save-always: true
- name: set up rust
uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown, x86_64-unknown-linux-gnu
- name: install cargo-stylus
run: RUSTFLAGS="-C link-args=-rdynamic" cargo install [email protected]
- name: setup nitro node
run: |
# clone nitro test node repo
git clone -b stylus --recurse-submodules https://github.com/OffchainLabs/nitro-testnode.git && cd nitro-testnode
# setup nitro test node
./test-node.bash --no-run --init --no-tokenbridge
./test-node.bash --detach
# fund Alice's wallet
./test-node.bash script send-l2 --to address_0x01fA6bf4Ee48B6C95900BCcf9BEA172EF5DBd478 --ethamount 10000
# fund Bob's wallet
./test-node.bash script send-l2 --to address_0xF4EaCDAbEf3c8f1EdE91b6f2A6840bc2E4DD3526 --ethamount 10000
- name: run integration tests
run: ./integration/test.sh