feat: local integration tests #1
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: e2e-tests | |
# This workflow runs our end-to-end tests suite. | |
# | |
# It roughly follows this steps: | |
# - A local `nitro-testnode` gets spun up. | |
# - Contracts get deployed to the local node. | |
# - A few addresses get funded. | |
# - The test suite runs. | |
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 tests 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 }}-cargo-bin-cargo-stylus@0.2.1 | |
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 cargo-stylus@0.2.1 | |
- 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 |