Skip to content

[unstable2507] Backport #10554 #22012

[unstable2507] Backport #10554

[unstable2507] Backport #10554 #22012

name: Zombienet Substrate
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1
LOCAL_DIR: "./substrate/zombienet"
GHA_CLUSTER_SERVER_ADDR: "https://kubernetes.default:443"
# use spot by default
X_INFRA_INSTANCE: "spot"
# don't retry sdk tests
NEXTEST_RETRIES: 0
KUBECONFIG: "/data/config"
ZOMBIE_CLEANER_DISABLED: 1
# DB generated from commit: https://github.com/paritytech/polkadot-sdk/commit/868788a5bff3ef94869bd36432726703fe3b4e96
# TODO: As a workaround for https://github.com/paritytech/polkadot-sdk/issues/2568 the DB was generated in archive mode.
# After the issue is fixed, we should replace it with a pruned version of the DB.
DB_SNAPSHOT: "https://storage.googleapis.com/zombienet-db-snaps/substrate/0001-basic-warp-sync/chains-9677807d738b951e9f6c82e5fd15518eb0ae0419.tgz"
DB_BLOCK_HEIGHT: 56687
DEFAULT_CONCURRENCY: 4
ZOMBIENET_PROVIDER: "native"
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/zombienet-reusable-preflight.yml
zombienet-substrate-0000-block-building:
needs: [preflight]
# only run if we have changes in ./substrate directory and the build workflow already finish with success status.
if: ${{ needs.preflight.outputs.changes_substrate || github.event_name == 'workflow_dispatch' }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_DEFAULT_RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
ZOMBIENET_INTEGRATION_TEST_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/substrate:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
DEBUG: "${{ needs.preflight.outputs.DEBUG }}"
steps:
- name: Checkout
uses: actions/checkout@v4
#
- name: zombienet_test
uses: ./.github/actions/zombienet
with:
test: "block-building.zndsl"
local-dir: "${{ env.LOCAL_DIR }}/0000-block-building"
concurrency: ${{ env.DEFAULT_CONCURRENCY }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}
ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
zombienet-substrate-0001-basic-warp-sync:
needs: [preflight]
# only run if we have changes in ./substrate directory and the build workflow already finish with success status.
if: ${{ needs.preflight.outputs.changes_substrate || github.event_name == 'workflow_dispatch' }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_DEFAULT_RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
ZOMBIENET_INTEGRATION_TEST_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/substrate:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
DEBUG: "${{ needs.preflight.outputs.DEBUG }}"
steps:
- name: Checkout
uses: actions/checkout@v4
#
- name: zombienet_test
uses: ./.github/actions/zombienet
with:
test: "test-warp-sync.zndsl"
local-dir: "${{ env.LOCAL_DIR }}/0001-basic-warp-sync"
concurrency: ${{ env.DEFAULT_CONCURRENCY }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}
ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
# TODO: Disabled, fails 1 in 50 runs
zombienet-substrate-0002-validators-warp-sync:
needs: [preflight]
# only run if we have changes in ./substrate directory and the build workflow already finish with success status.
if: ${{ (needs.preflight.outputs.changes_substrate || github.event_name == 'workflow_dispatch') && ! contains(needs.preflight.outputs.FLAKY_TESTS, 'zombienet-substrate-0002-validators-warp-sync') }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_LARGE_RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
ZOMBIENET_INTEGRATION_TEST_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/substrate:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
DEBUG: "${{ needs.preflight.outputs.DEBUG }}"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: cp_spec
shell: bash
run: |
cp --remove-destination ${LOCAL_DIR}/0001-basic-warp-sync/chain-spec.json ${LOCAL_DIR}/0002-validators-warp-sync
#
- name: zombienet_test
uses: ./.github/actions/zombienet
with:
test: "test-validators-warp-sync.zndsl"
local-dir: "${{ env.LOCAL_DIR }}/0002-validators-warp-sync"
concurrency: ${{ env.DEFAULT_CONCURRENCY }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}
ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
# TODO: Disabled, fails 1 in 50 runs
zombienet-substrate-0003-block-building-warp-sync:
needs: [preflight]
# only run if we have changes in ./substrate directory and the build workflow already finish with success status.
if: ${{ (needs.preflight.outputs.changes_substrate || github.event_name == 'workflow_dispatch') && ! contains(needs.preflight.outputs.FLAKY_TESTS, 'zombienet-substrate-0003-block-building-warp-sync') }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_DEFAULT_RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
ZOMBIENET_INTEGRATION_TEST_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/substrate:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: cp_spec
shell: bash
run: |
cp --remove-destination ${LOCAL_DIR}/0001-basic-warp-sync/chain-spec.json ${LOCAL_DIR}/0003-block-building-warp-sync
#
- name: zombienet_test
uses: ./.github/actions/zombienet
with:
test: "test-block-building-warp-sync.zndsl"
local-dir: "${{ env.LOCAL_DIR }}/0003-block-building-warp-sync"
concurrency: ${{ env.DEFAULT_CONCURRENCY }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}
ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}