From a1d72e04362ce94e22d8600d3208061c5ca480b1 Mon Sep 17 00:00:00 2001 From: Kirill Azovtsev Date: Mon, 24 Jun 2024 08:22:22 +0300 Subject: [PATCH] Check package version exists in build steps --- .github/workflows/zombie-tests.yaml | 86 ++++++++++++++++++++++------- 1 file changed, 66 insertions(+), 20 deletions(-) diff --git a/.github/workflows/zombie-tests.yaml b/.github/workflows/zombie-tests.yaml index 51c5876475..e8434ec5ba 100644 --- a/.github/workflows/zombie-tests.yaml +++ b/.github/workflows/zombie-tests.yaml @@ -37,13 +37,6 @@ jobs: - name: "Checkout repository" uses: actions/checkout@v4 - - name: "Cache dependencies" - uses: actions/cache@v4 - with: - path: ${{ env.CACHE_PATH }} - key: ${{ github.job }}-${{ env.CACHE_VERSION }}-${{ github.event.inputs.build_type }} - #save-always: true - - name: "Authenticate with Google Cloud" uses: 'google-github-actions/auth@v2' with: @@ -61,19 +54,27 @@ jobs: working-directory: ./housekeeping/docker/kagome-dev run: make get_versions -# - name: "Setup package version if not rebuilding" -# working-directory: ./housekeeping/docker/kagome-dev -# run: | -# ARTIFACTS_REPO=$(grep '^ARTIFACTS_REPO ?=' Makefile | sed 's/ARTIFACTS_REPO ?= //') -# REGION=$(grep '^REGION ?=' Makefile | sed 's/REGION ?= //') -# gcloud config set artifacts/repository $ARTIFACTS_REPO -# gcloud config set artifacts/location $REGION -# POLKADOT_BINARY_PACKAGE_VERSION=$(gcloud artifacts versions list --package=kagome-dev --format=json | \ -# jq -r 'sort_by(.createTime) | .[-1] | {version: (.name | split("/") | last), createTime: .createTime} | .version') -# echo "POLKADOT_BINARY_PACKAGE_VERSION=${POLKADOT_BINARY_PACKAGE_VERSION}" | tee -a variables.env + - name: "Check package version" + working-directory: ./housekeeping/docker/kagome-dev + run: | + ARTIFACTS_REPO=$(grep '^ARTIFACTS_REPO ?=' Makefile | sed 's/ARTIFACTS_REPO ?= //') + REGION=$(grep '^REGION ?=' Makefile | sed 's/REGION ?= //') + SHORT_COMMIT_HASH=$(grep 'short_commit_hash:' commit_hash.txt | cut -d ' ' -f 2) + gcloud config set artifacts/repository $ARTIFACTS_REPO + gcloud config set artifacts/location $REGION + PACKAGE_EXIST=$(gcloud artifacts versions list --package=kagome-dev --format=json | jq -e '.[] | select(.name | endswith("${SHORT_COMMIT_HASH}-${{ github.event.inputs.build_type }}"))' > /dev/null && echo "True" || echo "False") + echo "PACKAGE_EXIST=${PACKAGE_EXIST}" >> $GITHUB_ENV + + - name: "Cache dependencies" + if: github.env.PACKAGE_EXIST == 'False' + uses: actions/cache@v4 + with: + path: ${{ env.CACHE_PATH }} + key: ${{ github.job }}-${{ env.CACHE_VERSION }}-${{ github.event.inputs.build_type }} + #save-always: true - name: "Build target" - #if: github.event.inputs.polkadot_binaries_rebuild == 'true' + if: github.env.PACKAGE_EXIST == 'False' working-directory: ./housekeeping/docker/kagome-dev run: make kagome_dev_docker_build \ DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \ @@ -81,14 +82,59 @@ jobs: GITHUB_HUNTER_TOKEN=${{ secrets.HUNTER_TOKEN }} \ BUILD_TYPE=${{ github.event.inputs.build_type }} - - name: "Push Polkadot APT Package" - #if: github.event.inputs.polkadot_binaries_rebuild == 'true' + - name: "Push Kagome APT Package" + if: github.env.PACKAGE_EXIST == 'False' working-directory: ./housekeeping/docker/kagome-dev run: | SHORT_COMMIT_HASH=$(grep 'short_commit_hash:' commit_hash.txt | cut -d ' ' -f 2) make upload_apt_package \ BUILD_TYPE=${{ github.event.inputs.build_type }} + +# Zombie-Tests: +# runs-on: [ actions-runner-controller ] +# timeout-minutes: 60 +# needs: [kagome_dev_docker_build] +# strategy: +# fail-fast: false +# matrix: +# options: +# - name: "PVF preparation & execution time" +# test: "test-polkadot-functional-0001-parachains-pvf" +# - name: "Disputes initiation, conclusion and lag" +# test: "test-polkadot-functional-0002-parachains-disputes" +# - name: "BEEFY voting and finality, test MMR proofs. Assumes Rococo sessions of 1 minute" +# test: "test-polkadot-functional-0003-beefy-and-mmr" +# - name: "Dispute finality lag when 1/3 of parachain validators always attempt to include an invalid block" +# test: "test-polkadot-functional-0004-parachains-garbage-candidate" +# - name: "Past-session dispute slashing" +# test: "test-polkadot-functional-0005-parachains-disputes-past-session" +# - name: "Test if parachains make progress with most of approvals being tranch0" +# test: "test-polkadot-functional-0006-parachains-max-tranche0" +# - name: "Test if disputes triggered on finalized blocks within scope always end as valid" +# test: "test-polkadot-functional-0007-dispute-freshly-finalized" +# - name: "Test if disputes triggered on finalized blocks out of scope never get to be confirmed and concluded" +# test: "test-polkadot-functional-0008-dispute-old-finalized" +# - name: "Approval voting coalescing does not lag finality" +# test: "test-polkadot-functional-0009-approval-voting-coalescing" +# - name: "Test validator disabling effects" +# test: "test-polkadot-functional-0010-validator-disabling" +# - name: "Test we are producing blocks at 6 seconds clip" +# test: "test-polkadot-functional-0011-async-backing-6-seconds-rate" +# steps: +# - uses: actions/checkout@v4 +# - name: "Get Polkadot and Zombienet versions" +# working-directory: ./housekeeping/docker/kagome-dev +# run: make get_versions +# - name: Run test +# working-directory: ./zombienet/docker +# run: make ${{ matrix.options.test }} ZOMBIE_TESTER_IMAGE=${DOCKER_REGISTRY_PATH}zombie-tester:latest +# - name: Upload test logs as artifact +# if: always() +# uses: actions/upload-artifact@v4 +# with: +# name: logs-${{ matrix.options.test }} +# path: /tmp/test_logs # Prepare-Kagome-Docker: # strategy: