feat: local integration tests #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: integration | |
# This is an integration workflow that runs following jobs: | |
# - integration-test: 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: | |
test: | |
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 | |
toolchain: 1.77.0 | |
- 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 |