diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml new file mode 100644 index 0000000000..9f7e7362a7 --- /dev/null +++ b/.github/workflows/integration-test.yml @@ -0,0 +1,59 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Docker Integration Test + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +defaults: + run: + shell: bash + +jobs: + + build: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - name: Start 4 node docker cluster + run: make clean && make docker-cluster-start & + + - name: Wait for docker cluster to start + run: | + until [ $(cat build/generated/launch.complete |wc -l) = 4 ] + do + sleep 10 + done + + - name: Verify there are 4 validators running + run: | + NUM_VALIDATORS=$(docker exec -i sei-node0 build/seid q tendermint-validator-set |grep address |wc -l) + if [[ "$NUM_VALIDATORS" -eq 4 ]]; + then + echo "Number validators is correct: $NUM_VALIDATORS" + else + exit 1 + fi + + - name: Verify block height is keep increasing + run: | + HEIGHT_1=$(docker exec -i sei-node0 build/seid status |jq -r .SyncInfo.latest_block_height) + echo $HEIGHT_1 + sleep 15 + HEIGHT_2=$(docker exec -i sei-node0 build/seid status |jq -r .SyncInfo.latest_block_height) + echo $HEIGHT_2 + if [ "$HEIGHT_1" -ge "$HEIGHT_2" ]; + then + exit 1 + fi diff --git a/docker/localnode/scripts/step5_start_sei.sh b/docker/localnode/scripts/step5_start_sei.sh index 8ef3f29a9f..43a5f21419 100755 --- a/docker/localnode/scripts/step5_start_sei.sh +++ b/docker/localnode/scripts/step5_start_sei.sh @@ -9,6 +9,13 @@ mkdir -p $LOG_DIR echo "Starting the sei chain daemon" cp build/generated/genesis-sei.json ~/.sei/config/genesis.json ./build/seid start --chain-id sei > "$LOG_DIR"/seid-$NODE_ID.log 2>&1 & +echo "Done" >> build/generated/launch.complete echo "Server started successfully! Check your logs under $LOG_DIR/" -tail -f /dev/null \ No newline at end of file + +until [ $(cat build/generated/launch.complete |wc -l) = 4 ] +do + sleep 5 +done + +tail -f /dev/null