From e852bb00d3a3bc12acae884639b5cb5a342490e0 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 13:02:34 -0500 Subject: [PATCH 01/23] Restructure CI jobs Re-enable CLI E2E delivery checking --- .github/workflows/{node.yml => test.yml} | 108 +++++++++++++++----- typescript/cli/ci-test.sh | 124 ++++++++++++----------- 2 files changed, 144 insertions(+), 88 deletions(-) rename .github/workflows/{node.yml => test.yml} (66%) diff --git a/.github/workflows/node.yml b/.github/workflows/test.yml similarity index 66% rename from .github/workflows/node.yml rename to .github/workflows/test.yml index d39b37c0db..7ccc48c632 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: node +name: test on: # Triggers the workflow on push or pull request against main @@ -9,13 +9,23 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +concurrency: + group: e2e-${{ github.ref }} + cancel-in-progress: ${{ github.ref_name != 'main' }} + env: DEBUG: 'hyperlane:*' + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full jobs: - yarn-install: + install: runs-on: larger-runner steps: + - uses: actions/setup-node@v3 + with: + node-version: 18 + - uses: actions/checkout@v3 with: submodules: recursive @@ -38,19 +48,18 @@ jobs: exit 1 fi - yarn-build: + - name: foundry-install + uses: onbjerg/foundry-toolchain@v1 + + build: runs-on: larger-runner - needs: [yarn-install] + needs: [install] steps: - uses: actions/checkout@v3 with: submodules: recursive fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: yarn-cache uses: actions/cache@v3 with: @@ -70,7 +79,7 @@ jobs: lint-prettier: runs-on: larger-runner - needs: [yarn-install] + needs: [install] steps: - uses: actions/checkout@v3 with: @@ -96,18 +105,15 @@ jobs: exit 1 fi - test: + unit-test: runs-on: larger-runner - needs: [yarn-build] + needs: [build] steps: - uses: actions/checkout@v3 with: submodules: recursive fetch-depth: 0 - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - - uses: actions/cache@v3 with: path: ./* @@ -116,16 +122,69 @@ jobs: - name: Unit Tests run: yarn test - test-cli: + agent-build: runs-on: larger-runner - needs: [yarn-build] + needs: [install] steps: - uses: actions/checkout@v3 with: submodules: recursive - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 + - name: setup rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + + - name: Free disk space + run: | + # Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + - name: Install mold linker + uses: rui314/setup-mold@v1 + with: + mold-version: 2.0.0 + make-default: true + + - name: rust cache + uses: Swatinem/rust-cache@v2 + with: + prefix-key: 'v2-rust' + shared-key: 'e2e' + workspaces: | + ./rust + + - name: agent build + run: cargo build --release --bin run-locally + working-directory: ./rust + + agent-e2e: + runs-on: larger-runner + needs: [agent-build] + steps: + - name: run CosmWasm test + run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture + working-directory: ./rust + + - name: run test (excluding CosmWasm) + run: ./target/release/run-locally + working-directory: ./rust + env: + E2E_CI_MODE: 'true' + E2E_CI_TIMEOUT_SEC: '600' + E2E_KATHY_MESSAGES: '20' + + cli-e2e: + runs-on: larger-runner + needs: [agent-build] + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive - uses: actions/cache@v3 with: @@ -134,10 +193,11 @@ jobs: - name: test run: ./typescript/cli/ci-test.sh + working-directory: ./typescript/cli - test-env: + env-test: runs-on: larger-runner - needs: [yarn-build] + needs: [build] strategy: matrix: environment: [testnet4, mainnet3] @@ -150,15 +210,12 @@ jobs: path: ./* key: ${{ github.sha }} - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - - name: Test ${{ matrix.environment }} ${{ matrix.module }} deployment (check, deploy, govern, check again) run: cd typescript/infra && ./fork.sh ${{ matrix.environment }} ${{ matrix.module }} coverage: runs-on: larger-runner - needs: [yarn-build] + needs: [build] steps: - uses: actions/checkout@v3 @@ -178,9 +235,6 @@ jobs: .yarn/cache key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - - name: Run tests with coverage run: yarn coverage env: diff --git a/typescript/cli/ci-test.sh b/typescript/cli/ci-test.sh index 2c185f8357..7eab969fc3 100755 --- a/typescript/cli/ci-test.sh +++ b/typescript/cli/ci-test.sh @@ -103,67 +103,69 @@ yarn workspace @hyperlane-xyz/cli run hyperlane send transfer \ MESSAGE2_ID=`cat /tmp/message2 | grep "Message ID" | grep -E -o '0x[0-9a-f]+'` echo "Message 2 ID: $MESSAGE2_ID" -# ANVIL_CONNECTION_URL="http://127.0.0.1" -# cd ../../rust -# for i in "anvil1 8545 ANVIL1" "anvil2 8555 ANVIL2" -# do -# set -- $i -# echo "Running validator on $1" -# export CONFIG_FILES=/tmp/${AGENT_CONFIG_FILENAME} -# export HYP_ORIGINCHAINNAME=$1 -# export HYP_CHAINS_${3}_BLOCKS_REORGPERIOD=0 -# export HYP_VALIDATOR_INTERVAL=1 -# export HYP_CHAINS_${3}_CUSTOMRPCURLS=${ANVIL_CONNECTION_URL}:${2} -# export HYP_VALIDATOR_TYPE=hexKey -# export HYP_VALIDATOR_KEY=0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 -# export HYP_CHECKPOINTSYNCER_TYPE=localStorage -# export HYP_CHECKPOINTSYNCER_PATH=/tmp/${1}/validator -# export HYP_TRACING_LEVEL=debug -# export HYP_TRACING_FMT=compact - -# cargo run --bin validator > /tmp/${1}/validator-logs.txt & -# done - -# echo "Validator running, sleeping to let it sync" -# sleep 15 -# echo "Done sleeping" - -# echo "Validator Announcement:" -# cat /tmp/anvil1/validator/announcement.json - -# echo "Running relayer" - -# export HYP_RELAYCHAINS=anvil1,anvil2 -# export HYP_ALLOWLOCALCHECKPOINTSYNCERS=true -# export HYP_DB=/tmp/relayer -# export HYP_GASPAYMENTENFORCEMENT='[{"type":"none"}]' -# export HYP_CHAINS_ANVIL1_SIGNER_TYPE=hexKey -# export HYP_CHAINS_ANVIL1_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 -# export HYP_CHAINS_ANVIL2_SIGNER_TYPE=hexKey -# export HYP_CHAINS_ANVIL2_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 - -# cargo run --bin relayer > /tmp/relayer/relayer-logs.txt & - -# sleep 10 -# echo "Done running relayer, checking message delivery statuses" - -# for i in "1 $MESSAGE1_ID" "2 $MESSAGE2_ID" -# do -# set -- $i -# echo "Checking delivery status of $1: $2" -# yarn workspace @hyperlane-xyz/cli run hyperlane status \ -# --id $2 \ -# --destination anvil2 \ -# --chains ./examples/anvil-chains.yaml \ -# --core $CORE_ARTIFACTS_PATH \ -# | tee /tmp/message-status-$1 -# if ! grep -q "$2 was delivered" /tmp/message-status-$1; then -# echo "ERROR: Message $1 was not delivered" -# exit 1 -# else -# echo "Message $1 was delivered!" -# fi -# done +ANVIL_CONNECTION_URL="http://127.0.0.1" +cd ../../rust +for i in "anvil1 8545 ANVIL1" "anvil2 8555 ANVIL2" +do + set -- $i + echo "Running validator on $1" + export CONFIG_FILES=/tmp/${AGENT_CONFIG_FILENAME} + export HYP_ORIGINCHAINNAME=$1 + export HYP_CHAINS_${3}_BLOCKS_REORGPERIOD=0 + export HYP_VALIDATOR_INTERVAL=1 + export HYP_CHAINS_${3}_CUSTOMRPCURLS=${ANVIL_CONNECTION_URL}:${2} + export HYP_VALIDATOR_TYPE=hexKey + export HYP_VALIDATOR_KEY=0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 + export HYP_CHECKPOINTSYNCER_TYPE=localStorage + export HYP_CHECKPOINTSYNCER_PATH=/tmp/${1}/validator + export HYP_TRACING_LEVEL=debug + export HYP_TRACING_FMT=compact + + cargo run --bin validator > /tmp/${1}/validator-logs.txt & +done + +echo "Validator running, sleeping to let it sync" +# This needs to be long to allow time for the cargo build to finish +sleep 150 +echo "Done sleeping" + +echo "Validator Announcement:" +cat /tmp/anvil1/validator/announcement.json + +echo "Running relayer" + +export HYP_RELAYCHAINS=anvil1,anvil2 +export HYP_ALLOWLOCALCHECKPOINTSYNCERS=true +export HYP_DB=/tmp/relayer +export HYP_GASPAYMENTENFORCEMENT='[{"type":"none"}]' +export HYP_CHAINS_ANVIL1_SIGNER_TYPE=hexKey +export HYP_CHAINS_ANVIL1_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 +export HYP_CHAINS_ANVIL2_SIGNER_TYPE=hexKey +export HYP_CHAINS_ANVIL2_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 + +cargo run --bin relayer > /tmp/relayer/relayer-logs.txt & + +# This needs to be long to allow time for the cargo build to finish +sleep 30 +echo "Done running relayer, checking message delivery statuses" + +for i in "1 $MESSAGE1_ID" "2 $MESSAGE2_ID" +do + set -- $i + echo "Checking delivery status of $1: $2" + yarn workspace @hyperlane-xyz/cli run hyperlane status \ + --id $2 \ + --destination anvil2 \ + --chains ./examples/anvil-chains.yaml \ + --core $CORE_ARTIFACTS_PATH \ + | tee /tmp/message-status-$1 + if ! grep -q "$2 was delivered" /tmp/message-status-$1; then + echo "ERROR: Message $1 was not delivered" + exit 1 + else + echo "Message $1 was delivered!" + fi +done pkill -f anvil echo "Done" From 4b62e5317d5a98f4db7a4f9fefd9a0013c3383bd Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 13:21:54 -0500 Subject: [PATCH 02/23] Attempt 2 --- .github/workflows/test.yml | 47 ++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ccc48c632..7411c3caef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: test +name: test on: # Triggers the workflow on push or pull request against main @@ -48,9 +48,6 @@ jobs: exit 1 fi - - name: foundry-install - uses: onbjerg/foundry-toolchain@v1 - build: runs-on: larger-runner needs: [install] @@ -86,7 +83,8 @@ jobs: # check out full history fetch-depth: 0 - - uses: actions/cache@v3 + - name: yarn-cache + uses: actions/cache@v3 with: path: | **/node_modules @@ -114,7 +112,11 @@ jobs: submodules: recursive fetch-depth: 0 - - uses: actions/cache@v3 + - name: foundry-install + uses: onbjerg/foundry-toolchain@v1 + + - name: build-cache + uses: actions/cache@v3 with: path: ./* key: ${{ github.sha }} @@ -124,12 +126,14 @@ jobs: agent-build: runs-on: larger-runner - needs: [install] steps: - uses: actions/checkout@v3 with: submodules: recursive + - name: foundry-install + uses: onbjerg/foundry-toolchain@v1 + - name: setup rust uses: actions-rs/toolchain@v1 with: @@ -166,6 +170,21 @@ jobs: runs-on: larger-runner needs: [agent-build] steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: foundry-install + uses: onbjerg/foundry-toolchain@v1 + + - name: rust cache + uses: Swatinem/rust-cache@v2 + with: + prefix-key: 'v2-rust' + shared-key: 'e2e' + workspaces: | + ./rust + - name: run CosmWasm test run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture working-directory: ./rust @@ -180,13 +199,23 @@ jobs: cli-e2e: runs-on: larger-runner - needs: [agent-build] + needs: [build, agent-build] steps: - uses: actions/checkout@v3 with: submodules: recursive + fetch-depth: 0 - - uses: actions/cache@v3 + - name: yarn-cache + uses: actions/cache@v3 + with: + path: | + **/node_modules + .yarn/cache + key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} + + - name: build-cache + uses: actions/cache@v3 with: path: ./* key: ${{ github.sha }} From 7769ab64de63ef2b1cab13dd8a9d33f96344bfbc Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 13:40:20 -0500 Subject: [PATCH 03/23] Attempt 3 --- .github/workflows/test.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7411c3caef..d70433e254 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -154,7 +154,7 @@ jobs: mold-version: 2.0.0 make-default: true - - name: rust cache + - name: rust-cache uses: Swatinem/rust-cache@v2 with: prefix-key: 'v2-rust' @@ -162,10 +162,16 @@ jobs: workspaces: | ./rust - - name: agent build + - name: agent-build run: cargo build --release --bin run-locally working-directory: ./rust + - name: agent-build-cache + uses: actions/cache@v3 + with: + path: ./rust/* + key: ${{ github.sha }} + agent-e2e: runs-on: larger-runner needs: [agent-build] @@ -173,6 +179,12 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive + + - name: agent-build-cache + uses: actions/cache@v3 + with: + path: ./rust/* + key: ${{ github.sha }} - name: foundry-install uses: onbjerg/foundry-toolchain@v1 @@ -220,8 +232,14 @@ jobs: path: ./* key: ${{ github.sha }} + - name: agent-build-cache + uses: actions/cache@v3 + with: + path: ./rust/* + key: ${{ github.sha }} + - name: test - run: ./typescript/cli/ci-test.sh + run: ./ci-test.sh working-directory: ./typescript/cli env-test: From 160ecd8f74fd069648bd24bc0d1bbd56df365111 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 13:54:59 -0500 Subject: [PATCH 04/23] Attempt 4 --- .github/workflows/test.yml | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d70433e254..d14be64fee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -159,18 +159,12 @@ jobs: with: prefix-key: 'v2-rust' shared-key: 'e2e' - workspaces: | - ./rust + workspaces: ./rust - name: agent-build run: cargo build --release --bin run-locally working-directory: ./rust - - name: agent-build-cache - uses: actions/cache@v3 - with: - path: ./rust/* - key: ${{ github.sha }} agent-e2e: runs-on: larger-runner @@ -179,12 +173,6 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - - name: agent-build-cache - uses: actions/cache@v3 - with: - path: ./rust/* - key: ${{ github.sha }} - name: foundry-install uses: onbjerg/foundry-toolchain@v1 @@ -194,8 +182,7 @@ jobs: with: prefix-key: 'v2-rust' shared-key: 'e2e' - workspaces: | - ./rust + workspaces: ./rust - name: run CosmWasm test run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture @@ -232,11 +219,12 @@ jobs: path: ./* key: ${{ github.sha }} - - name: agent-build-cache - uses: actions/cache@v3 + - name: rust-cache + uses: Swatinem/rust-cache@v2 with: - path: ./rust/* - key: ${{ github.sha }} + prefix-key: 'v2-rust' + shared-key: 'e2e' + workspaces: ./rust - name: test run: ./ci-test.sh From 325be69a7ecd2d2576001773e7fafa88b6d06589 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 14:01:10 -0500 Subject: [PATCH 05/23] Revert to 2, tests not running --- .github/workflows/test.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d14be64fee..c6f5790cae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -154,18 +154,18 @@ jobs: mold-version: 2.0.0 make-default: true - - name: rust-cache + - name: rust cache uses: Swatinem/rust-cache@v2 with: prefix-key: 'v2-rust' shared-key: 'e2e' - workspaces: ./rust + workspaces: | + ./rust - - name: agent-build + - name: agent build run: cargo build --release --bin run-locally working-directory: ./rust - agent-e2e: runs-on: larger-runner needs: [agent-build] @@ -182,7 +182,8 @@ jobs: with: prefix-key: 'v2-rust' shared-key: 'e2e' - workspaces: ./rust + workspaces: | + ./rust - name: run CosmWasm test run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture @@ -219,15 +220,8 @@ jobs: path: ./* key: ${{ github.sha }} - - name: rust-cache - uses: Swatinem/rust-cache@v2 - with: - prefix-key: 'v2-rust' - shared-key: 'e2e' - workspaces: ./rust - - name: test - run: ./ci-test.sh + run: ./typescript/cli/ci-test.sh working-directory: ./typescript/cli env-test: @@ -278,4 +272,4 @@ jobs: - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 1b713383bff7282a72c93b5d56a0f9206483dd42 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 14:07:59 -0500 Subject: [PATCH 06/23] Attempt 5 --- .github/workflows/test.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6f5790cae..617930a6e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -173,6 +173,12 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive + + - name: setup rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal - name: foundry-install uses: onbjerg/foundry-toolchain@v1 @@ -206,6 +212,23 @@ jobs: submodules: recursive fetch-depth: 0 + - name: setup rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + + - name: foundry-install + uses: onbjerg/foundry-toolchain@v1 + + - name: rust cache + uses: Swatinem/rust-cache@v2 + with: + prefix-key: 'v2-rust' + shared-key: 'e2e' + workspaces: | + ./rust + - name: yarn-cache uses: actions/cache@v3 with: @@ -221,7 +244,7 @@ jobs: key: ${{ github.sha }} - name: test - run: ./typescript/cli/ci-test.sh + run: ./ci-test.sh working-directory: ./typescript/cli env-test: From 59d8c8fe5187d208cebc4d391c22619f2cfba934 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 14:26:51 -0500 Subject: [PATCH 07/23] Attempt 6 --- .github/workflows/test.yml | 9 +++------ typescript/cli/ci-test.sh | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 617930a6e8..ee88791cf3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -159,8 +159,7 @@ jobs: with: prefix-key: 'v2-rust' shared-key: 'e2e' - workspaces: | - ./rust + workspaces: ./rust -> target - name: agent build run: cargo build --release --bin run-locally @@ -188,8 +187,7 @@ jobs: with: prefix-key: 'v2-rust' shared-key: 'e2e' - workspaces: | - ./rust + workspaces: ./rust -> target - name: run CosmWasm test run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture @@ -226,8 +224,7 @@ jobs: with: prefix-key: 'v2-rust' shared-key: 'e2e' - workspaces: | - ./rust + workspaces: ./rust -> target - name: yarn-cache uses: actions/cache@v3 diff --git a/typescript/cli/ci-test.sh b/typescript/cli/ci-test.sh index 7eab969fc3..d34b69ce50 100755 --- a/typescript/cli/ci-test.sh +++ b/typescript/cli/ci-test.sh @@ -126,7 +126,7 @@ done echo "Validator running, sleeping to let it sync" # This needs to be long to allow time for the cargo build to finish -sleep 150 +sleep 120 echo "Done sleeping" echo "Validator Announcement:" @@ -146,7 +146,7 @@ export HYP_CHAINS_ANVIL2_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22f cargo run --bin relayer > /tmp/relayer/relayer-logs.txt & # This needs to be long to allow time for the cargo build to finish -sleep 30 +sleep 60 echo "Done running relayer, checking message delivery statuses" for i in "1 $MESSAGE1_ID" "2 $MESSAGE2_ID" From eebf33ef49e7bd3e18fb25c054714c4ccd8b2408 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 14:52:21 -0500 Subject: [PATCH 08/23] Attempt 7 --- .github/workflows/test.yml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee88791cf3..5b7f5c6ab5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -154,12 +154,12 @@ jobs: mold-version: 2.0.0 make-default: true - - name: rust cache - uses: Swatinem/rust-cache@v2 + - name: agent-build-cache + uses: actions/cache@v3 with: - prefix-key: 'v2-rust' - shared-key: 'e2e' - workspaces: ./rust -> target + path: | + ./rust/target + ~/.cargo - name: agent build run: cargo build --release --bin run-locally @@ -182,12 +182,13 @@ jobs: - name: foundry-install uses: onbjerg/foundry-toolchain@v1 - - name: rust cache - uses: Swatinem/rust-cache@v2 + - name: agent-build-cache + uses: actions/cache@v3 with: - prefix-key: 'v2-rust' - shared-key: 'e2e' - workspaces: ./rust -> target + path: | + ./rust/target + ~/.cargo + key: rust-${{ github.sha }} - name: run CosmWasm test run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture @@ -219,13 +220,6 @@ jobs: - name: foundry-install uses: onbjerg/foundry-toolchain@v1 - - name: rust cache - uses: Swatinem/rust-cache@v2 - with: - prefix-key: 'v2-rust' - shared-key: 'e2e' - workspaces: ./rust -> target - - name: yarn-cache uses: actions/cache@v3 with: @@ -240,6 +234,13 @@ jobs: path: ./* key: ${{ github.sha }} + - name: agent-build-cache + uses: actions/cache@v3 + with: + path: | + ./rust/target + ~/.cargo + - name: test run: ./ci-test.sh working-directory: ./typescript/cli From a9a51f3ebb25536b0332f3236aafa0f32fde297d Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Thu, 23 Nov 2023 14:56:37 -0500 Subject: [PATCH 09/23] Attempt 8 --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b7f5c6ab5..fb57665d2b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -160,6 +160,7 @@ jobs: path: | ./rust/target ~/.cargo + key: rust-${{ github.sha }} - name: agent build run: cargo build --release --bin run-locally @@ -240,6 +241,7 @@ jobs: path: | ./rust/target ~/.cargo + key: rust-${{ github.sha }} - name: test run: ./ci-test.sh From cdab5be5a7dd88879da9713ce31a8bf84c764ba2 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Fri, 24 Nov 2023 10:56:41 -0500 Subject: [PATCH 10/23] Replace larger-runners with ubuntu-latest --- .github/workflows/e2e.yml | 77 --------------------------- .github/workflows/monorepo-docker.yml | 4 +- .github/workflows/release.yml | 2 +- .github/workflows/rust-docker.yml | 4 +- .github/workflows/rust-skipped.yml | 4 +- .github/workflows/static-analysis.yml | 2 +- .github/workflows/test.yml | 20 +++---- 7 files changed, 19 insertions(+), 94 deletions(-) delete mode 100644 .github/workflows/e2e.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index 9481b2d145..0000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: e2e - -on: - push: - branches: [main] - pull_request: - workflow_dispatch: - -concurrency: - group: e2e-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: full - -defaults: - run: - working-directory: ./rust - -jobs: - e2e: - runs-on: larger-runner - steps: - - uses: actions/setup-node@v3 - with: - node-version: 16 - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: setup rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 - - - name: Free disk space - run: | - # Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - - name: Install mold linker - uses: rui314/setup-mold@v1 - with: - mold-version: 2.0.0 - make-default: true - - name: rust cache - uses: Swatinem/rust-cache@v2 - with: - prefix-key: 'v2-rust' - shared-key: 'e2e' - workspaces: | - ./rust - - name: node module cache - uses: actions/cache@v3 - with: - path: | - **/node_modules - .yarn/cache - key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} - - name: build test - run: cargo build --release --bin run-locally - - name: run CosmWasm test - run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture - - name: run test (excluding CosmWasm) - run: ./target/release/run-locally - env: - E2E_CI_MODE: 'true' - E2E_CI_TIMEOUT_SEC: '600' - E2E_KATHY_MESSAGES: '20' diff --git a/.github/workflows/monorepo-docker.yml b/.github/workflows/monorepo-docker.yml index af71889120..9952c3507e 100644 --- a/.github/workflows/monorepo-docker.yml +++ b/.github/workflows/monorepo-docker.yml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true jobs: check-env: - runs-on: larger-runner + runs-on: ubuntu-latest # assign output from step to job output outputs: gcloud-service-key: ${{ steps.gcloud-service-key.outputs.defined }} @@ -27,7 +27,7 @@ jobs: run: echo "::set-output name=defined::true" build-and-push-to-gcr: - runs-on: larger-runner + runs-on: ubuntu-latest # uses check-env to determine if secrets.GCLOUD_SERVICE_KEY is defined needs: [check-env] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25e82feead..84c0164c0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: contents: write pull-requests: write name: Release - runs-on: larger-runner + runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 diff --git a/.github/workflows/rust-docker.yml b/.github/workflows/rust-docker.yml index 4c64a7cb1c..7c75426f97 100644 --- a/.github/workflows/rust-docker.yml +++ b/.github/workflows/rust-docker.yml @@ -12,7 +12,7 @@ concurrency: cancel-in-progress: true jobs: check-env: - runs-on: larger-runner + runs-on: ubuntu-latest # assign output from step to job output outputs: gcloud-service-key: ${{ steps.gcloud-service-key.outputs.defined }} @@ -26,7 +26,7 @@ jobs: run: echo "::set-output name=defined::true" build-and-push-to-gcr: - runs-on: larger-runner + runs-on: ubuntu-latest # uses check-env to determine if secrets.GCLOUD_SERVICE_KEY is defined needs: [check-env] diff --git a/.github/workflows/rust-skipped.yml b/.github/workflows/rust-skipped.yml index 9a8d0e07ed..bd2669ac17 100644 --- a/.github/workflows/rust-skipped.yml +++ b/.github/workflows/rust-skipped.yml @@ -12,13 +12,13 @@ env: jobs: test-rs: - runs-on: larger-runner + runs-on: ubuntu-latest steps: - run: 'echo "No test required" ' lint-rs: - runs-on: larger-runner + runs-on: ubuntu-latest steps: - run: 'echo "No lint required" ' diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 9154cd520e..5dcf53bad9 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -9,7 +9,7 @@ on: jobs: slither: - runs-on: larger-runner + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb57665d2b..8155830153 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ env: jobs: install: - runs-on: larger-runner + runs-on: ubuntu-latest steps: - uses: actions/setup-node@v3 with: @@ -49,7 +49,7 @@ jobs: fi build: - runs-on: larger-runner + runs-on: ubuntu-latest needs: [install] steps: - uses: actions/checkout@v3 @@ -75,7 +75,7 @@ jobs: run: yarn build lint-prettier: - runs-on: larger-runner + runs-on: ubuntu-latest needs: [install] steps: - uses: actions/checkout@v3 @@ -104,7 +104,7 @@ jobs: fi unit-test: - runs-on: larger-runner + runs-on: ubuntu-latest needs: [build] steps: - uses: actions/checkout@v3 @@ -167,7 +167,7 @@ jobs: working-directory: ./rust agent-e2e: - runs-on: larger-runner + runs-on: ubuntu-latest needs: [agent-build] steps: - uses: actions/checkout@v3 @@ -204,7 +204,7 @@ jobs: E2E_KATHY_MESSAGES: '20' cli-e2e: - runs-on: larger-runner + runs-on: ubuntu-latest needs: [build, agent-build] steps: - uses: actions/checkout@v3 @@ -232,7 +232,9 @@ jobs: - name: build-cache uses: actions/cache@v3 with: - path: ./* + path: | + ./solidity + ./typescript key: ${{ github.sha }} - name: agent-build-cache @@ -248,7 +250,7 @@ jobs: working-directory: ./typescript/cli env-test: - runs-on: larger-runner + runs-on: ubuntu-latest needs: [build] strategy: matrix: @@ -266,7 +268,7 @@ jobs: run: cd typescript/infra && ./fork.sh ${{ matrix.environment }} ${{ matrix.module }} coverage: - runs-on: larger-runner + runs-on: ubuntu-latest needs: [build] steps: From 032ea4a6a91374ab50ea09944be9c70dc8bef28c Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Fri, 24 Nov 2023 11:11:08 -0500 Subject: [PATCH 11/23] Use more specific ts build caching --- .github/workflows/test.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8155830153..fe6d64faf5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,7 +68,9 @@ jobs: - name: build-cache uses: actions/cache@v3 with: - path: ./* + path: | + ./solidity + ./typescript key: ${{ github.sha }} - name: build @@ -118,7 +120,9 @@ jobs: - name: build-cache uses: actions/cache@v3 with: - path: ./* + path: | + ./solidity + ./typescript key: ${{ github.sha }} - name: Unit Tests @@ -259,9 +263,13 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 + + - name: build-cache + uses: actions/cache@v3 with: - path: ./* + path: | + ./solidity + ./typescript key: ${{ github.sha }} - name: Test ${{ matrix.environment }} ${{ matrix.module }} deployment (check, deploy, govern, check again) @@ -276,11 +284,6 @@ jobs: with: fetch-depth: 0 - - uses: actions/cache@v3 - with: - path: ./* - key: ${{ github.sha }} - - name: yarn-cache uses: actions/cache@v3 with: @@ -289,6 +292,14 @@ jobs: .yarn/cache key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} + - name: build-cache + uses: actions/cache@v3 + with: + path: | + ./solidity + ./typescript + key: ${{ github.sha }} + - name: Run tests with coverage run: yarn coverage env: From a5b44628d1f27b2fde9792cd2c1b27423d755204 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Fri, 24 Nov 2023 11:17:51 -0500 Subject: [PATCH 12/23] Attempt 11 --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe6d64faf5..e70cce599e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: with: path: | **/node_modules - .yarn/cache + .yarn key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} - name: yarn-install @@ -62,7 +62,7 @@ jobs: with: path: | **/node_modules - .yarn/cache + .yarn key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} - name: build-cache @@ -90,7 +90,7 @@ jobs: with: path: | **/node_modules - .yarn/cache + .yarn key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} - name: lint @@ -230,7 +230,7 @@ jobs: with: path: | **/node_modules - .yarn/cache + .yarn key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} - name: build-cache @@ -289,7 +289,7 @@ jobs: with: path: | **/node_modules - .yarn/cache + .yarn key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }} - name: build-cache From 01219a7013da003e81c482550e5a5f57450dc085 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Fri, 24 Nov 2023 11:26:16 -0500 Subject: [PATCH 13/23] Attempt 12 --- .github/workflows/test.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e70cce599e..75faa5244b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,8 +69,8 @@ jobs: uses: actions/cache@v3 with: path: | - ./solidity - ./typescript + ./* + !./rust key: ${{ github.sha }} - name: build @@ -121,8 +121,8 @@ jobs: uses: actions/cache@v3 with: path: | - ./solidity - ./typescript + ./* + !./rust key: ${{ github.sha }} - name: Unit Tests @@ -237,8 +237,8 @@ jobs: uses: actions/cache@v3 with: path: | - ./solidity - ./typescript + ./* + !./rust key: ${{ github.sha }} - name: agent-build-cache @@ -268,8 +268,8 @@ jobs: uses: actions/cache@v3 with: path: | - ./solidity - ./typescript + ./* + !./rust key: ${{ github.sha }} - name: Test ${{ matrix.environment }} ${{ matrix.module }} deployment (check, deploy, govern, check again) @@ -296,8 +296,8 @@ jobs: uses: actions/cache@v3 with: path: | - ./solidity - ./typescript + ./* + !./rust key: ${{ github.sha }} - name: Run tests with coverage From ddb16b8aae3dc36ad102d599f8c316fb945795ad Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Fri, 24 Nov 2023 11:41:34 -0500 Subject: [PATCH 14/23] Rename some jobs --- .github/workflows/test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75faa5244b..b6122d7beb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ env: RUST_BACKTRACE: full jobs: - install: + yarn-install: runs-on: ubuntu-latest steps: - uses: actions/setup-node@v3 @@ -48,9 +48,9 @@ jobs: exit 1 fi - build: + yarn-build: runs-on: ubuntu-latest - needs: [install] + needs: [yarn-install] steps: - uses: actions/checkout@v3 with: @@ -78,7 +78,7 @@ jobs: lint-prettier: runs-on: ubuntu-latest - needs: [install] + needs: [yarn-install] steps: - uses: actions/checkout@v3 with: @@ -105,9 +105,9 @@ jobs: exit 1 fi - unit-test: + yarn-test: runs-on: ubuntu-latest - needs: [build] + needs: [yarn-build] steps: - uses: actions/checkout@v3 with: @@ -209,7 +209,7 @@ jobs: cli-e2e: runs-on: ubuntu-latest - needs: [build, agent-build] + needs: [yarn-build, agent-build] steps: - uses: actions/checkout@v3 with: @@ -255,7 +255,7 @@ jobs: env-test: runs-on: ubuntu-latest - needs: [build] + needs: [yarn-build] strategy: matrix: environment: [testnet4, mainnet3] @@ -277,7 +277,7 @@ jobs: coverage: runs-on: ubuntu-latest - needs: [build] + needs: [yarn-build] steps: - uses: actions/checkout@v3 From ce827af3eb1b5a1ab8fd346a9da996768b8b0ca8 Mon Sep 17 00:00:00 2001 From: nambrot Date: Fri, 24 Nov 2023 21:55:06 +0100 Subject: [PATCH 15/23] use arc for agent building --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6122d7beb..7762507e90 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -129,7 +129,7 @@ jobs: run: yarn test agent-build: - runs-on: larger-runner + runs-on: arc-runner-set steps: - uses: actions/checkout@v3 with: From 4ac24cbdad021749739357419eced40f071c93b3 Mon Sep 17 00:00:00 2001 From: nambrot Date: Fri, 24 Nov 2023 21:58:18 +0100 Subject: [PATCH 16/23] Move foundry install --- .github/workflows/test.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7762507e90..e101ca41a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,6 +75,8 @@ jobs: - name: build run: yarn build + - name: foundry-install + uses: onbjerg/foundry-toolchain@v1 lint-prettier: runs-on: ubuntu-latest @@ -113,10 +115,6 @@ jobs: with: submodules: recursive fetch-depth: 0 - - - name: foundry-install - uses: onbjerg/foundry-toolchain@v1 - - name: build-cache uses: actions/cache@v3 with: @@ -183,9 +181,6 @@ jobs: with: toolchain: stable profile: minimal - - - name: foundry-install - uses: onbjerg/foundry-toolchain@v1 - name: agent-build-cache uses: actions/cache@v3 From 6599a984c7ddf61e52a323ce5e8afa6eac98e897 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sat, 25 Nov 2023 10:04:01 -0500 Subject: [PATCH 17/23] Join agent and cli e2e tests --- .github/workflows/test.yml | 96 +++++++++++--------------------------- 1 file changed, 26 insertions(+), 70 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e101ca41a6..56af2fda0a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,8 +75,6 @@ jobs: - name: build run: yarn build - - name: foundry-install - uses: onbjerg/foundry-toolchain@v1 lint-prettier: runs-on: ubuntu-latest @@ -115,6 +113,10 @@ jobs: with: submodules: recursive fetch-depth: 0 + + - name: foundry-install + uses: onbjerg/foundry-toolchain@v1 + - name: build-cache uses: actions/cache@v3 with: @@ -126,7 +128,7 @@ jobs: - name: Unit Tests run: yarn test - agent-build: + e2e: runs-on: arc-runner-set steps: - uses: actions/checkout@v3 @@ -156,70 +158,6 @@ jobs: mold-version: 2.0.0 make-default: true - - name: agent-build-cache - uses: actions/cache@v3 - with: - path: | - ./rust/target - ~/.cargo - key: rust-${{ github.sha }} - - - name: agent build - run: cargo build --release --bin run-locally - working-directory: ./rust - - agent-e2e: - runs-on: ubuntu-latest - needs: [agent-build] - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: setup rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - - name: agent-build-cache - uses: actions/cache@v3 - with: - path: | - ./rust/target - ~/.cargo - key: rust-${{ github.sha }} - - - name: run CosmWasm test - run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture - working-directory: ./rust - - - name: run test (excluding CosmWasm) - run: ./target/release/run-locally - working-directory: ./rust - env: - E2E_CI_MODE: 'true' - E2E_CI_TIMEOUT_SEC: '600' - E2E_KATHY_MESSAGES: '20' - - cli-e2e: - runs-on: ubuntu-latest - needs: [yarn-build, agent-build] - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - - name: setup rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - - name: foundry-install - uses: onbjerg/foundry-toolchain@v1 - - name: yarn-cache uses: actions/cache@v3 with: @@ -236,13 +174,28 @@ jobs: !./rust key: ${{ github.sha }} - - name: agent-build-cache + - name: cargo-cache uses: actions/cache@v3 with: path: | - ./rust/target ~/.cargo - key: rust-${{ github.sha }} + key: ${{ runner.os }}-cargo-cache-${{ hashFiles('./rust/Cargo.lock') }} + + - name: agent build + run: cargo build --release --bin run-locally + working-directory: ./rust + + - name: run agent test with CosmWasm + run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture + working-directory: ./rust + + - name: run agent test excluding CosmWasm + run: ./target/release/run-locally + working-directory: ./rust + env: + E2E_CI_MODE: 'true' + E2E_CI_TIMEOUT_SEC: '600' + E2E_KATHY_MESSAGES: '20' - name: test run: ./ci-test.sh @@ -259,6 +212,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: foundry-install + uses: onbjerg/foundry-toolchain@v1 + - name: build-cache uses: actions/cache@v3 with: From 0d3b0d9268885ad82d17450ed1e3f88204f4fb3c Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sat, 25 Nov 2023 10:17:49 -0500 Subject: [PATCH 18/23] Wait for yarn build before e2e --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56af2fda0a..fe68fee7a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -130,6 +130,7 @@ jobs: e2e: runs-on: arc-runner-set + needs: [yarn-build] steps: - uses: actions/checkout@v3 with: @@ -185,11 +186,11 @@ jobs: run: cargo build --release --bin run-locally working-directory: ./rust - - name: run agent test with CosmWasm + - name: agent tests with CosmWasm run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture working-directory: ./rust - - name: run agent test excluding CosmWasm + - name: agent tests excluding CosmWasm run: ./target/release/run-locally working-directory: ./rust env: @@ -197,7 +198,7 @@ jobs: E2E_CI_TIMEOUT_SEC: '600' E2E_KATHY_MESSAGES: '20' - - name: test + - name: cli e2e tests run: ./ci-test.sh working-directory: ./typescript/cli From 8b7213d3358ff80ff3eb6e3dd52a2393529821d1 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sat, 25 Nov 2023 10:19:31 -0500 Subject: [PATCH 19/23] Remove old docker-based cli e2e script --- typescript/cli/ci-test-docker.sh | 159 ------------------------------- 1 file changed, 159 deletions(-) delete mode 100755 typescript/cli/ci-test-docker.sh diff --git a/typescript/cli/ci-test-docker.sh b/typescript/cli/ci-test-docker.sh deleted file mode 100755 index 416f3847ef..0000000000 --- a/typescript/cli/ci-test-docker.sh +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env bash - -# Optional cleanup for previous runs, useful when running locally -pkill -f anvil -docker ps -aq | xargs docker stop | xargs docker rm -rm -rf /tmp/anvil* -rm -rf /tmp/relayer - -# Setup directories for anvil chains -for CHAIN in anvil1 anvil2 -do - mkdir -p /tmp/$CHAIN /tmp/$CHAIN/state /tmp/$CHAIN/validator /tmp/relayer - chmod -R 777 /tmp/relayer /tmp/$CHAIN -done - -anvil --chain-id 31337 -p 8545 --state /tmp/anvil1/state > /dev/null & -anvil --chain-id 31338 -p 8555 --state /tmp/anvil2/state > /dev/null & -sleep 1 - -set -e - -echo "{}" > /tmp/empty-artifacts.json - -export DEBUG=hyperlane:* - -echo "Deploying contracts to anvil1 and anvil2" -yarn workspace @hyperlane-xyz/cli run hyperlane deploy core \ - --targets anvil1,anvil2 \ - --chains ./examples/anvil-chains.yaml \ - --artifacts /tmp/empty-artifacts.json \ - --ism ./examples/multisig-ism.yaml \ - --hook ./examples/hook-config.yaml \ - --out /tmp \ - --key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ - --yes - -CORE_ARTIFACTS_PATH=`find /tmp/core-deployment* -type f -exec ls -t1 {} + | head -1` -echo "Core artifacts:" -echo $CORE_ARTIFACTS_PATH - -AGENT_CONFIG_FILENAME=`ls -t1 /tmp | grep agent-config | head -1` - -echo "Deploying warp routes" -yarn workspace @hyperlane-xyz/cli run hyperlane deploy warp \ - --chains ./examples/anvil-chains.yaml \ - --core $CORE_ARTIFACTS_PATH \ - --config ./examples/warp-tokens.yaml \ - --out /tmp \ - --key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ - --yes - -echo "Sending test message" -yarn workspace @hyperlane-xyz/cli run hyperlane send message \ - --origin anvil1 \ - --destination anvil2 \ - --chains ./examples/anvil-chains.yaml \ - --core $CORE_ARTIFACTS_PATH \ - --quick \ - --key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ - | tee /tmp/message1 - -MESSAGE1_ID=`cat /tmp/message1 | grep "Message ID" | grep -E -o '0x[0-9a-f]+'` -echo "Message 1 ID: $MESSAGE1_ID" - -WARP_ARTIFACTS_FILE=`find /tmp/warp-deployment* -type f -exec ls -t1 {} + | head -1` -ANVIL1_ROUTER=`cat $WARP_ARTIFACTS_FILE | jq -r ".anvil1.router"` - -echo "Sending test warp transfer" -yarn workspace @hyperlane-xyz/cli run hyperlane send transfer \ - --origin anvil1 \ - --destination anvil2 \ - --chains ./examples/anvil-chains.yaml \ - --core $CORE_ARTIFACTS_PATH \ - --router $ANVIL1_ROUTER \ - --type native \ - --quick \ - --key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ - | tee /tmp/message2 - -MESSAGE2_ID=`cat /tmp/message2 | grep "Message ID" | grep -E -o '0x[0-9a-f]+'` -echo "Message 2 ID: $MESSAGE2_ID" - - -if [[ $OSTYPE == 'darwin'* ]]; then - # Required because the -net=host driver only works on linux - DOCKER_CONNECTION_URL="http://host.docker.internal" -else - DOCKER_CONNECTION_URL="http://127.0.0.1" -fi - -for i in "anvil1 8545 ANVIL1" "anvil2 8555 ANVIL2" -do - set -- $i - echo "Running validator on $1" - docker run \ - --mount type=bind,source="/tmp",target=/data --net=host \ - -e CONFIG_FILES=/data/${AGENT_CONFIG_FILENAME} -e HYP_ORIGINCHAINNAME=$1 \ - -e HYP_VALIDATOR_REORGPERIOD=0 -e HYP_VALIDATOR_INTERVAL=1 \ - -e HYP_CHAINS_${3}_CUSTOMRPCURLS=${DOCKER_CONNECTION_URL}:${2} \ - -e HYP_CHAINS_${3}_BLOCKS_REORGPERIOD=0 \ - -e HYP_VALIDATOR_TYPE=hexKey \ - -e HYP_VALIDATOR_KEY=0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 \ - -e HYP_CHECKPOINTSYNCER_TYPE=localStorage \ - -e HYP_CHECKPOINTSYNCER_PATH=/data/${1}/validator \ - -e HYP_TRACING_LEVEL=debug -e HYP_TRACING_FMT=compact \ - gcr.io/abacus-labs-dev/hyperlane-agent:b92ecd3-20231115-182824 ./validator > /tmp/${1}/validator-logs.txt & -done - -echo "Validator running, sleeping to let it sync" -sleep 15 -echo "Done sleeping" - -echo "Validator Announcement:" -cat /tmp/anvil1/validator/announcement.json - -echo "Running relayer" - -docker run \ - --mount type=bind,source="/tmp",target=/data --net=host \ - -e CONFIG_FILES=/data/${AGENT_CONFIG_FILENAME} \ - -e HYP_CHAINS_ANVIL1_CUSTOMRPCURLS=${DOCKER_CONNECTION_URL}:8545 \ - -e HYP_CHAINS_ANVIL2_CUSTOMRPCURLS=${DOCKER_CONNECTION_URL}:8555 \ - -e HYP_CHAINS_ANVIL1_BLOCKS_REORGPERIOD=0 \ - -e HYP_CHAINS_ANVIL2_BLOCKS_REORGPERIOD=0 \ - -e HYP_TRACING_LEVEL=debug -e HYP_TRACING_FMT=compact \ - -e HYP_RELAYCHAINS=anvil1,anvil2 \ - -e HYP_ALLOWLOCALCHECKPOINTSYNCERS=true \ - -e HYP_DB=/data/relayer \ - -e HYP_GASPAYMENTENFORCEMENT='[{"type":"none"}]' \ - -e HYP_CHAINS_ANVIL1_SIGNER_TYPE=hexKey \ - -e HYP_CHAINS_ANVIL1_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 \ - -e HYP_CHAINS_ANVIL2_SIGNER_TYPE=hexKey \ - -e HYP_CHAINS_ANVIL2_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 \ - gcr.io/abacus-labs-dev/hyperlane-agent:b92ecd3-20231115-182824 ./relayer > /tmp/relayer/relayer-logs.txt & - -sleep 10 -echo "Done running relayer, checking message delivery statuses" - -for i in "1 $MESSAGE1_ID" "2 $MESSAGE2_ID" -do - set -- $i - echo "Checking delivery status of $1: $2" - yarn workspace @hyperlane-xyz/cli run hyperlane status \ - --id $2 \ - --destination anvil2 \ - --chains ./examples/anvil-chains.yaml \ - --core $CORE_ARTIFACTS_PATH \ - | tee /tmp/message-status-$1 - if ! grep -q "$2 was delivered" /tmp/message-status-$1; then - echo "ERROR: Message $1 was not delivered" - exit 1 - else - echo "Message $1 was delivered!" - fi -done - -docker ps -aq | xargs docker stop | xargs docker rm -pkill -f anvil -echo "Done" From deb4ab73acf7e6e561c227df2bcd2d894a4a4cb9 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sat, 25 Nov 2023 10:25:16 -0500 Subject: [PATCH 20/23] Force node 18 for e2e tests --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe68fee7a5..c1758dc043 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,6 +132,10 @@ jobs: runs-on: arc-runner-set needs: [yarn-build] steps: + - uses: actions/setup-node@v3 + with: + node-version: 18 + - uses: actions/checkout@v3 with: submodules: recursive From d850f990a9a6520724b49cc3aa6ab1d8f379c74e Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sun, 26 Nov 2023 18:34:10 -0500 Subject: [PATCH 21/23] Skip rust workflow on push to main Move e2e test back to github --- .github/workflows/mergify.yml.bak | 65 ------------------------------ .github/workflows/rust-skipped.yml | 5 ++- .github/workflows/rust.yml | 3 +- .github/workflows/test.yml | 2 +- typescript/cli/ci-test.sh | 12 ++++-- 5 files changed, 14 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/mergify.yml.bak diff --git a/.github/workflows/mergify.yml.bak b/.github/workflows/mergify.yml.bak deleted file mode 100644 index 2adc55518f..0000000000 --- a/.github/workflows/mergify.yml.bak +++ /dev/null @@ -1,65 +0,0 @@ -name: automerge - -on: - pull_request: - types: - - labeled - - unlabeled - - synchronize - - opened - - edited - - ready_for_review - - reopened - - unlocked - - pull_request_review: - types: - - submitted - - repository_dispatch: - types: [rust-tests-successful, solidity-tests-successful] - - status: {} - -jobs: - automerge: - - runs-on: larger-runner - - steps: - - name: automerge - if: ${{ secrets.ACTIONS_PAT }} - uses: pascalgn/automerge-action@v0.13.1 - env: - GITHUB_TOKEN: "${{ secrets.ACTIONS_PAT }}" - MERGE_LABELS: "automerge" - MERGE_REMOVE_LABELS: "automerge" - MERGE_METHOD: "squash" - -# in rust.yml - complete: - runs-on: larger-runner - needs: [build, test, lint] - - steps: - - name: Rust tests successful - if: success() - uses: peter-evans/repository-dispatch@v1 - with: - token: ${{ secrets.ACTIONS_PAT }} - repository: ${{ github.repository }} - event-type: rust-tests-successful - -# in solidity.yml - complete: - runs-on: larger-runner - needs: [install, lint, test] - - steps: - - name: Solidity tests successful - if: success() - uses: peter-evans/repository-dispatch@v1 - with: - token: ${{ secrets.ACTIONS_PAT }} - repository: ${{ github.repository }} - event-type: solidity-tests-successful diff --git a/.github/workflows/rust-skipped.yml b/.github/workflows/rust-skipped.yml index bd2669ac17..b6e6c51cd7 100644 --- a/.github/workflows/rust-skipped.yml +++ b/.github/workflows/rust-skipped.yml @@ -2,10 +2,13 @@ name: rust on: + push: + branches: [main] pull_request: - branches: [main, v3] + branches: [main] paths-ignore: - 'rust/**' + - .github/workflows/rust.yml env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ebb5623de5..bfda6c1aca 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,9 +1,8 @@ name: rust on: - push: - branches: [main] pull_request: + branches: [main] paths: - 'rust/**' - .github/workflows/rust.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1758dc043..b37ab05bbe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -129,7 +129,7 @@ jobs: run: yarn test e2e: - runs-on: arc-runner-set + runs-on: larger-runner needs: [yarn-build] steps: - uses: actions/setup-node@v3 diff --git a/typescript/cli/ci-test.sh b/typescript/cli/ci-test.sh index d34b69ce50..071bc00b74 100755 --- a/typescript/cli/ci-test.sh +++ b/typescript/cli/ci-test.sh @@ -103,6 +103,9 @@ yarn workspace @hyperlane-xyz/cli run hyperlane send transfer \ MESSAGE2_ID=`cat /tmp/message2 | grep "Message ID" | grep -E -o '0x[0-9a-f]+'` echo "Message 2 ID: $MESSAGE2_ID" +echo "Pre-building validator with cargo" +cargo build --release --bin validator + ANVIL_CONNECTION_URL="http://127.0.0.1" cd ../../rust for i in "anvil1 8545 ANVIL1" "anvil2 8555 ANVIL2" @@ -126,14 +129,16 @@ done echo "Validator running, sleeping to let it sync" # This needs to be long to allow time for the cargo build to finish -sleep 120 +sleep 20 echo "Done sleeping" echo "Validator Announcement:" cat /tmp/anvil1/validator/announcement.json -echo "Running relayer" +echo "Pre-building relayer with cargo" +cargo build --release --bin relayer +echo "Running relayer" export HYP_RELAYCHAINS=anvil1,anvil2 export HYP_ALLOWLOCALCHECKPOINTSYNCERS=true export HYP_DB=/tmp/relayer @@ -142,11 +147,10 @@ export HYP_CHAINS_ANVIL1_SIGNER_TYPE=hexKey export HYP_CHAINS_ANVIL1_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 export HYP_CHAINS_ANVIL2_SIGNER_TYPE=hexKey export HYP_CHAINS_ANVIL2_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 - cargo run --bin relayer > /tmp/relayer/relayer-logs.txt & # This needs to be long to allow time for the cargo build to finish -sleep 60 +sleep 20 echo "Done running relayer, checking message delivery statuses" for i in "1 $MESSAGE1_ID" "2 $MESSAGE2_ID" From 684d543421134c9280809b7730d08456042dee97 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sun, 26 Nov 2023 19:04:31 -0500 Subject: [PATCH 22/23] Run cli test from monorepo root --- .github/workflows/test.yml | 1 - typescript/cli/ci-test.sh | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b37ab05bbe..84f4f5e3c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -204,7 +204,6 @@ jobs: - name: cli e2e tests run: ./ci-test.sh - working-directory: ./typescript/cli env-test: runs-on: ubuntu-latest diff --git a/typescript/cli/ci-test.sh b/typescript/cli/ci-test.sh index 071bc00b74..de3d887cc6 100755 --- a/typescript/cli/ci-test.sh +++ b/typescript/cli/ci-test.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# NOTE: This script is intended to be run from the root of the repo + # Optional cleanup for previous runs, useful when running locally pkill -f anvil rm -rf /tmp/anvil* @@ -103,11 +105,11 @@ yarn workspace @hyperlane-xyz/cli run hyperlane send transfer \ MESSAGE2_ID=`cat /tmp/message2 | grep "Message ID" | grep -E -o '0x[0-9a-f]+'` echo "Message 2 ID: $MESSAGE2_ID" +cd ./rust echo "Pre-building validator with cargo" -cargo build --release --bin validator +cargo build --bin validator ANVIL_CONNECTION_URL="http://127.0.0.1" -cd ../../rust for i in "anvil1 8545 ANVIL1" "anvil2 8555 ANVIL2" do set -- $i @@ -129,14 +131,14 @@ done echo "Validator running, sleeping to let it sync" # This needs to be long to allow time for the cargo build to finish -sleep 20 +sleep 15 echo "Done sleeping" echo "Validator Announcement:" cat /tmp/anvil1/validator/announcement.json echo "Pre-building relayer with cargo" -cargo build --release --bin relayer +cargo build --bin relayer echo "Running relayer" export HYP_RELAYCHAINS=anvil1,anvil2 From ab18db74007cfbb8fcb6e36f01a45a78f5b08cc5 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sun, 26 Nov 2023 19:22:56 -0500 Subject: [PATCH 23/23] Fix e2e script path --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84f4f5e3c2..7b7d9d5c99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -203,7 +203,7 @@ jobs: E2E_KATHY_MESSAGES: '20' - name: cli e2e tests - run: ./ci-test.sh + run: ./typescript/cli/ci-test.sh env-test: runs-on: ubuntu-latest