Skip to content

Commit

Permalink
Check package version exists in build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
qdrvm-ci committed Jun 24, 2024
1 parent 3fd35c6 commit a1d72e0
Showing 1 changed file with 66 additions and 20 deletions.
86 changes: 66 additions & 20 deletions .github/workflows/zombie-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -61,34 +54,87 @@ 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} \
GITHUB_HUNTER_USERNAME=${{ secrets.HUNTER_USERNAME }} \
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:
Expand Down

0 comments on commit a1d72e0

Please sign in to comment.