Skip to content

Zombie-Tests

Zombie-Tests #431

Workflow file for this run

#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#
name: Zombie-Tests
on:
workflow_dispatch:
inputs:
build_type:
description: 'Build type'
required: true
default: 'Release'
type: 'choice'
options:
- Release
- Debug
- RelWithDebInfo
werror:
description: 'Enable -Werror'
required: true
default: 'OFF'
type: 'choice'
options:
- 'ON'
- 'OFF'
use_cache:
description: 'Use cache for build'
required: true
default: 'true'
type: 'choice'
options:
- 'true'
- 'false'
builder_latest_tag:
description: 'Custom Builder tag'
default: 'latest'
required: false
type: 'string'
zombie_tester_latest_tag:
description: 'Custom Zombie Tester tag'
default: 'latest'
required: false
type: 'string'
env:
DOCKER_REGISTRY_PATH: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/kagome-dev/
PROJECT_ID: ${{ secrets.GCP_PROJECT }}
BUILD_DIR: build
CTEST_OUTPUT_ON_FAILURE: 1
CI: true
CACHE_VERSION: v01
CACHE_PATH: ./build/cache
USE_CACHE: ${{ github.event.inputs.use_cache || 'true' }}
BUILDER_LATEST_TAG: ${{ github.event.inputs.builder_latest_tag || 'latest' }}
TESTER_LATEST_TAG: ${{ github.event.inputs.zombie_tester_latest_tag || 'latest' }}
jobs:
kagome_dev_docker_build:
runs-on: [ actions-runner-controller ]
timeout-minutes: 180
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Get master branch"
if: github.ref != 'refs/heads/master'
run: git fetch origin master:master || true
- name: "Authenticate with Google Cloud"
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: "Set up Cloud SDK"
uses: 'google-github-actions/setup-gcloud@v2'
- name: "Configure Docker for GCR"
run: |
gcloud auth configure-docker --quiet
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet
- name: "Get commit version"
working-directory: ./housekeeping/docker/kagome-dev
run: make get_versions
- 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)
PACKAGE_VERSION="$(date +'%y.%m.%d')-${SHORT_COMMIT_HASH}-${{ github.event.inputs.build_type }}"
echo "PACKAGE_VERSION=${PACKAGE_VERSION}"
echo "package_version=${PACKAGE_VERSION}" >> $GITHUB_ENV
echo "short_commit_hash=${SHORT_COMMIT_HASH}" >> $GITHUB_ENV
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(\"${PACKAGE_VERSION}\"))" > /dev/null && echo "True" || echo "False")
echo "package_exist=${PACKAGE_EXIST}" >> $GITHUB_ENV
- name: "Cache dependencies"
if: ${{ env.package_exist == 'False' && env.USE_CACHE == 'true' }}
id: cache-restore
uses: actions/cache/restore@v4
with:
path: ${{ env.CACHE_PATH }}
key: ${{ github.job }}-${{ env.CACHE_VERSION }}-${{ github.event.inputs.build_type }}-${{ env.short_commit_hash }}
restore-keys: |
${{ github.job }}-${{ env.CACHE_VERSION }}-${{ github.event.inputs.build_type }}-
- name: "Build target"
if: 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 }} \
BUILDER_IMAGE_TAG=${{ env.BUILDER_LATEST_TAG }} \
WERROR=${{ github.event.inputs.werror }}
- name: "Push Kagome APT Package"
if: 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 }}
- name: Set up Docker Buildx
if: env.package_exist == 'False'
uses: docker/[email protected]
- name: "Build Docker Image"
if: env.package_exist == 'False'
working-directory: ./housekeeping/docker/kagome-dev
run: make kagome_image_build \
KAGOME_PACKAGE_VERSION=${{ env.package_version }} \
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \
BUILD_TYPE=${{ github.event.inputs.build_type }}
- name: "Push Docker Image"
if: env.package_exist == 'False'
working-directory: ./housekeeping/docker/kagome-dev
run: make kagome_image_push \
DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \
BUILD_TYPE=${{ github.event.inputs.build_type }}
- name: "Always Save Cache"
id: cache-save
if: always() && (steps.cache-restore.outputs.cache-hit != 'true' || env.package_exist != 'True')
uses: actions/cache/save@v4
with:
path: ${{ env.CACHE_PATH }}
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
- name: "Versions Info"
if: always()
run: |
echo "Kagome Package Version: kagome-dev ${{ env.package_version }}"
echo "Kagome Images: "
cat /tmp/docker_image.env || true
cat /tmp/dockerhub_image.env || true
Zombie-Tests:
runs-on: ubuntu-latest
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"
- name: "Systematic chunk recovery is used if the chunk mapping feature is enabled."
test: "test-polkadot-functional-0013-systematic-chunk-recovery"
- name: "Warp sync from polkadot node"
test: "test-custom-0001-validators-warp-sync"
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: Create and enable swap
run: |
free -h
df -h
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
free -h
df -h
- name: "Authenticate with Google Cloud"
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: "Set up Cloud SDK"
uses: 'google-github-actions/setup-gcloud@v2'
- name: "Configure Docker for GCR"
run: |
gcloud auth configure-docker --quiet
gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet
- name: "Get commit version"
working-directory: ./housekeeping/docker/kagome-dev
run: make get_versions
- name: "Get 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)
PACKAGE_VERSION="$(date +'%y.%m.%d')-${SHORT_COMMIT_HASH}-${{ github.event.inputs.build_type }}"
echo "PACKAGE_VERSION=${PACKAGE_VERSION}"
echo "package_version=${PACKAGE_VERSION}" >> $GITHUB_ENV
- name: "Get Zombie Tester Version"
run: |
ZOMBIE_TESTER_IMAGE=${DOCKER_REGISTRY_PATH}zombie_tester:${{ env.TESTER_LATEST_TAG }}
echo "zombie_tester_image=${ZOMBIE_TESTER_IMAGE}"
echo "zombie_tester_image=${ZOMBIE_TESTER_IMAGE}" >> $GITHUB_ENV
- name: "Run test"
working-directory: ./zombienet/docker
run: |
make ${{ matrix.options.test }} \
ZOMBIE_TESTER_IMAGE=${{ env.zombie_tester_image }} \
KAGOME_PACKAGE_VERSION=${{ env.package_version }}
free -h
df -h
- name: "Upload test logs as artifact"
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.options.test }}
path: /tmp/test_logs
- name: "Versions Info"
if: always()
run: |
echo "Kagome Package Version: kagome-dev ${{ env.package_version }}"
echo "Zombie Tester Image: ${{ env.zombie_tester_image }}"
echo "Zombie Tests Versions: "
cat /tmp/versions.env || true
- name: "Show system info"
if: always()
run: |
free -h
df -h