feat: support testnets #1963
This file contains hidden or 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: Hermes Relayer | |
| on: | |
| pull_request: | |
| paths: | |
| - cairo-libs/** | |
| - cairo-contracts/** | |
| - relayer/** | |
| - light-client/** | |
| - attestator/** | |
| - .github/workflows/hermes.yaml | |
| - flake.lock | |
| push: | |
| branches: | |
| - main | |
| # Cancel previous runs of this workflow when a new commit is added to the PR, branch or tag | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| starknet-integration-tests: | |
| name: Run Starknet Integration Tests | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, ubuntu-22.04-arm, macos-13] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| if: ${{ matrix.os != 'macos-13' }} | |
| uses: jlumbroso/free-disk-space@main | |
| - name: Setup Docker (macOS 13) | |
| if: ${{ matrix.os == 'macos-13' }} | |
| uses: douglascamata/setup-docker-macos-action@main | |
| - uses: actions/checkout@v5 | |
| - name: Checkout Madara | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: madara-alliance/madara | |
| ref: 4118ad97fe2d70bacc239ce2ca4225752a49f628 # main branch | |
| path: madara | |
| - uses: cachix/install-nix-action@v30 | |
| with: | |
| extra_nix_config: | | |
| experimental-features = nix-command flakes | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: ibc-starknet | |
| extraPullNames: hermes-sdk,cosmos-nix | |
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| - name: Install Scarb | |
| uses: software-mansion/setup-scarb@v1 | |
| with: | |
| tool-versions: cairo-contracts/.tool-versions | |
| scarb-lock: cairo-contracts/Scarb.lock | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| workspaces: | | |
| relayer | |
| light-client | |
| attestator | |
| madara/madara | |
| - name: Install Madara | |
| id: madara-from-docker | |
| continue-on-error: true | |
| run: | | |
| MADARA_REVISION=4118ad9 # nightly revision | |
| MADARA_DOCKER_PATH=`docker run --name madara-container --entrypoint which "ghcr.io/madara-alliance/madara:nightly-${MADARA_REVISION}" madara` | |
| docker cp "madara-container:${MADARA_DOCKER_PATH}" "${HOME}/.cargo/bin/madara" | |
| chmod u+x "${HOME}/.cargo/bin/madara" | |
| madara --help > /dev/null | |
| - name: Build and Install Madara | |
| if: steps.madara-from-docker.outcome == 'failure' | |
| run: | | |
| cd madara | |
| nix develop -c cargo install --path madara/node --bin madara --locked --force | |
| - name: Build Cairo contracts | |
| working-directory: ./cairo-contracts | |
| run: | | |
| scarb --profile release build -p starknet_ibc_contracts | |
| - name: Build Madara contracts | |
| working-directory: ./madara-contracts | |
| run: | | |
| scarb --profile release build | |
| - name: Run Integration Tests | |
| env: | |
| RUST_BACKTRACE: 1 | |
| RUST_LOG: debug | |
| TEST_THREADS: 4 | |
| working-directory: ./relayer | |
| run: | | |
| export ERC20_CONTRACT="$(pwd)/../cairo-contracts/target/release/starknet_ibc_contracts_ERC20Mintable.contract_class.json" | |
| export ICS20_CONTRACT="$(pwd)/../cairo-contracts/target/release/starknet_ibc_contracts_TransferApp.contract_class.json" | |
| export COMET_CLIENT_CONTRACT="$(pwd)/../cairo-contracts/target/release/starknet_ibc_contracts_CometClient.contract_class.json" | |
| export IBC_CORE_CONTRACT="$(pwd)/../cairo-contracts/target/release/starknet_ibc_contracts_IBCCore.contract_class.json" | |
| export STARKNET_BIN="$HOME/.cargo/bin/madara" | |
| export COMET_LIB_CONTRACT="$(pwd)/../cairo-contracts/target/release/starknet_ibc_contracts_CometLib.contract_class.json" | |
| export ICS23_LIB_CONTRACT="$(pwd)/../cairo-contracts/target/release/starknet_ibc_contracts_Ics23Lib.contract_class.json" | |
| export PROTOBUF_LIB_CONTRACT="$(pwd)/../cairo-contracts/target/release/starknet_ibc_contracts_ProtobufLib.contract_class.json" | |
| export RAW_STORAGE_CONTRACT="$(pwd)/../madara-contracts/target/release/madara_contracts_RawStore.contract_class.json" | |
| export STARKNET_WASM_CLIENT_PATH="$(nix build ..#ibc-starknet-cw --print-out-paths)/ibc_client_starknet_cw.wasm" | |
| ROCKET_PORT=1234 PRIVATE_KEY=0x1234 cargo run --manifest-path ../attestator/Cargo.toml --bin attestator --release --locked & | |
| ROCKET_PORT=1235 PRIVATE_KEY=0x1235 cargo run --manifest-path ../attestator/Cargo.toml --bin attestator --release --locked & | |
| ROCKET_PORT=1236 PRIVATE_KEY=0x1236 cargo run --manifest-path ../attestator/Cargo.toml --bin attestator --release --locked & | |
| export ED25519_ATTESTATORS="http://localhost:1234,http://localhost:1235,http://localhost:1236" | |
| cargo run --quiet --example contract_size "$ERC20_CONTRACT" | |
| cargo run --quiet --example contract_size "$ICS20_CONTRACT" | |
| cargo run --quiet --example contract_size "$COMET_CLIENT_CONTRACT" | |
| cargo run --quiet --example contract_size "$IBC_CORE_CONTRACT" | |
| cargo run --quiet --example contract_size "$COMET_LIB_CONTRACT" | |
| cargo run --quiet --example contract_size "$ICS23_LIB_CONTRACT" | |
| cargo run --quiet --example contract_size "$PROTOBUF_LIB_CONTRACT" | |
| nix shell \ | |
| ..#osmosis \ | |
| ..#wasm-simapp \ | |
| ..#rust \ | |
| ..#cargo-nextest \ | |
| -c \ | |
| cargo nextest run --release \ | |
| --workspace \ | |
| --retries 2 \ | |
| --test-threads=$TEST_THREADS \ | |
| --success-output=final \ | |
| --filter-expr '!(test(modified_test_suite::))' | |
| COSMOS_TRUSTING_PERIOD=30 COSMOS_REFRESH_RATE=20 \ | |
| nix shell \ | |
| ..#osmosis \ | |
| ..#wasm-simapp \ | |
| ..#rust \ | |
| ..#cargo-nextest \ | |
| -c \ | |
| cargo nextest run --release \ | |
| --workspace \ | |
| --retries 2 \ | |
| --test-threads=$TEST_THREADS \ | |
| --success-output=final \ | |
| -- modified_test_suite | |
| lint-relayer: | |
| name: Lint Relayer Code | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: cachix/install-nix-action@v30 | |
| with: | |
| extra_nix_config: | | |
| experimental-features = nix-command flakes | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: ibc-starknet | |
| extraPullNames: hermes-sdk,cosmos-nix | |
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| workspaces: | | |
| relayer | |
| - name: Run Clippy | |
| working-directory: ./relayer | |
| run: | | |
| nix shell ..#rust -c \ | |
| cargo clippy --all-targets --all-features -- -D warnings |