Skip to content

Commit

Permalink
ci: Run the ITs against multiple API providers
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-l committed Apr 23, 2024
1 parent 97cf2f5 commit 39f32b8
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: rust-integration-tests
name: rust-integration-tests-alchemy
on:
schedule:
- cron: "0 8,20 * * *"
Expand All @@ -8,7 +8,7 @@ on:
jobs:
integration:
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -19,11 +19,10 @@ jobs:

- name: start beerus RPC on MAINNET
env:
BEERUS_VERSION: "ci"
NETWORK: "mainnet"
ETH_EXECUTION_RPC: ${{ secrets.ETH_EXECUTION_RPC_MAINNET }}
STARKNET_RPC: ${{ secrets.STARKNET_RPC_0_6_0_MAINNET }}
run: ./target/release/beerus & while ! timeout 1 bash -c "echo > /dev/tcp/localhost/3030" 2> /dev/null; do sleep 2; done
STARKNET_RPC: ${{ secrets.STARKNET_RPC_0_6_0_MAINNET_ALCHEMY }}
# Start Beerus, then try to reach the port every second for 60 seconds.
run: ./target/release/beerus & for i in {1..60}; do timeout 1 bash -c "echo > /dev/tcp/localhost/3030" 2> /dev/null && break || sleep 1; done

- name: run integration test on MAINNET
run: cargo test --package beerus-rpc --features integration-tests
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/rust-integration-tests-chainstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: rust-integration-tests-chainstack
on:
schedule:
- cron: "0 8,20 * * *"
workflow_dispatch:

jobs:
integration:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: build beerus
run: cargo build -p beerus-cli --release

- name: start beerus RPC on MAINNET
env:
ETH_EXECUTION_RPC: ${{ secrets.ETH_EXECUTION_RPC_MAINNET }}
STARKNET_RPC: ${{ secrets.STARKNET_RPC_0_6_0_MAINNET_CHAINSTACK }}
# Start Beerus, then try to reach the port every second for 60 seconds.
run: ./target/release/beerus & for i in {1..60}; do timeout 1 bash -c "echo > /dev/tcp/localhost/3030" 2> /dev/null && break || sleep 1; done

- name: run integration test on MAINNET
run: cargo test --package beerus-rpc --features integration-tests

- name: stop RPC
run: kill $(lsof -t -i:3030)

31 changes: 31 additions & 0 deletions .github/workflows/rust-integration-tests-reddio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: rust-integration-tests-reddio
on:
schedule:
- cron: "0 8,20 * * *"
workflow_dispatch:

jobs:
integration:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: build beerus
run: cargo build -p beerus-cli --release

- name: start beerus RPC on MAINNET
env:
ETH_EXECUTION_RPC: ${{ secrets.ETH_EXECUTION_RPC_MAINNET }}
STARKNET_RPC: ${{ secrets.STARKNET_RPC_0_6_0_MAINNET_REDDIO }}
# Start Beerus, then try to reach the port every second for 60 seconds.
run: ./target/release/beerus & for i in {1..60}; do timeout 1 bash -c "echo > /dev/tcp/localhost/3030" 2> /dev/null && break || sleep 1; done

- name: run integration test on MAINNET
run: cargo test --package beerus-rpc --features integration-tests

- name: stop RPC
run: kill $(lsof -t -i:3030)

0 comments on commit 39f32b8

Please sign in to comment.