From 8cbb50f4311ecc40e07a11a3e61b5e1f72eb785a Mon Sep 17 00:00:00 2001 From: evgeniy-scherbina Date: Mon, 12 Aug 2024 14:16:38 -0400 Subject: [PATCH] Previous commit actually work; update CI in this commit --- .../scripts/kava-localnet-ci/construction.sh | 4 ++++ .github/scripts/kava-localnet-ci/setup.sh | 18 ++++++++++++++++++ .github/workflows/process_kava_dispatch.yml | 18 +++++++++++++++--- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100755 .github/scripts/kava-localnet-ci/construction.sh create mode 100755 .github/scripts/kava-localnet-ci/setup.sh diff --git a/.github/scripts/kava-localnet-ci/construction.sh b/.github/scripts/kava-localnet-ci/construction.sh new file mode 100755 index 0000000..5204dee --- /dev/null +++ b/.github/scripts/kava-localnet-ci/construction.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "start check:construction" +./bin/rosetta-cli --configuration-file ${GITHUB_WORKSPACE}/rosetta-kava/rosetta-cli-conf/kava-testnet-ci/config.json check:construction diff --git a/.github/scripts/kava-localnet-ci/setup.sh b/.github/scripts/kava-localnet-ci/setup.sh new file mode 100755 index 0000000..b6ddce7 --- /dev/null +++ b/.github/scripts/kava-localnet-ci/setup.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +make run-local & +make run-local-offline & + +sleep 5 + +block_tip=($(curl -s --location --request POST 'http://localhost:8000/network/status' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "network_identifier": { + "blockchain": "Kava", + "network": "kava-localnet" + } +}' | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["current_block_identifier"]["index"])')) + +echo "latest block index is", $block_tip + diff --git a/.github/workflows/process_kava_dispatch.yml b/.github/workflows/process_kava_dispatch.yml index 94de7b8..e3b65ca 100644 --- a/.github/workflows/process_kava_dispatch.yml +++ b/.github/workflows/process_kava_dispatch.yml @@ -54,11 +54,23 @@ jobs: - name: Wait until kava node is ready to serve traffic run: bash ${GITHUB_WORKSPACE}/rosetta-kava/.github/scripts/wait-for-node-init.sh -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 - - name: Run integration tests run: KAVA_RPC_URL=http://localhost:26657 NETWORK=kava-local PORT=4000 SKIP_LIVE_NODE_TESTS=true make test-integration working-directory: ./rosetta-kava + - name: Download cli + run: "curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-cli/master/scripts/install.sh | sh -s" + working-directory: ./rosetta-kava + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + + - name: Start rosetta server + run: .github/scripts/kava-localnet-ci/setup.sh + shell: bash + working-directory: ./rosetta-kava + - name: Run Check:construction test + run: .github/scripts/kava-localnet-ci/construction.sh + shell: bash + working-directory: ./rosetta-kava \ No newline at end of file