Skip to content

Nightly test

Nightly test #1252

Workflow file for this run

name: Nightly test
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202507112050
RUST_INFO: rustup show && cargo --version && rustup +nightly show && cargo +nightly --version
jobs:
set-image:
# GitHub Actions does not allow using 'env' in a container context.
# This workaround sets the container image for each job using 'set-image' job output.
runs-on: parity-large
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- id: set_image
run: echo "IMAGE=${{ env.IMAGE }}" >> $GITHUB_OUTPUT
nightly-test:
runs-on: parity-large
needs: [set-image]
container: ${{ needs.set-image.outputs.IMAGE }}
strategy:
matrix:
channel:
- name: "Staking Miner Dev"
room: "!tXyUlsDAYvDfRKbzKx:parity.io"
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Checkout polkadot-sdk
uses: actions/checkout@v6
with:
repository: paritytech/polkadot-sdk
ref: master
path: polkadot-sdk
- name: Install dependencies
run: |
# Install netcat for port checking
apt-get update && apt-get install -y netcat
# Install just
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
# Install bun
curl -fsSL https://bun.sh/install | bash
echo "$HOME/.bun/bin" >> $GITHUB_PATH
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "18"
- name: Install zombienet globally
run: npm install -g @zombienet/cli
- name: Verify installations
run: |
zombienet --help
just --version
bun --version
- name: Cache Rust dependencies for polkadot-sdk
uses: swatinem/rust-cache@v2
with:
workspaces: |
polkadot-sdk
key: ${{ runner.os }}-rust-polkadot-sdk-${{ hashFiles('polkadot-sdk/**/Cargo.lock') }}
cache-on-failure: true
- name: Cache Rust dependencies for staking-miner
uses: swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-rust-staking-miner-${{ hashFiles('**/Cargo.lock') }}
cache-on-failure: true
- name: Build node binaries and prepare chains
working-directory: polkadot-sdk/substrate/frame/staking-async/runtimes/papi-tests
shell: bash
run: |
# Build the node binaries that zombienet needs
echo "🔧 Building polkadot and polkadot-parachain binaries..."
cargo build --release --features fast-runtime -p polkadot -p polkadot-parachain-bin
# Create symlinks so zombienet can find the binaries when it spawns a new bash shell
ln -sf "$(pwd)/../../../../../target/release/polkadot" /usr/local/bin/polkadot
ln -sf "$(pwd)/../../../../../target/release/polkadot-parachain" /usr/local/bin/polkadot-parachain
ln -sf "$(pwd)/../../../../../target/release/polkadot-execute-worker" /usr/local/bin/polkadot-execute-worker
ln -sf "$(pwd)/../../../../../target/release/polkadot-prepare-worker" /usr/local/bin/polkadot-prepare-worker
just setup
- name: Build integration test
run: |
echo "🔧 Building integration test..."
cargo test --release --features integration-tests --no-run
- name: Start zombienet
working-directory: polkadot-sdk/substrate/frame/staking-async/runtimes/papi-tests
shell: bash
run: |
# Start zombienet and wait for ws endpoints to be ready
# TODO: use fake-dot instead (or run the test for each profile: fake-dot, fake-ksm, fake-dev, ...).
# Currently there is an issue for which while running with `fake-dot/ksm` profile, Zombienet setup doesn't work correctly,
# election doesn't start and we are stuck in election phase.
just run fake-dev 2>&1 &
echo "⏳ Waiting for chains to be ready (ws endpoints on 9944, 9945 and 9946)..."
for port in 9944 9945 9946; do
for i in {1..24}; do
if nc -z localhost $port; then
echo "✅ Port $port is open."
break
fi
sleep 10
if [ $i -eq 24 ]; then
echo "❌ Timeout waiting for port $port"
just killall
exit 1
fi
done
done
echo "✅ Zombienet is ready for tests!"
- name: Run integration test
run: |
RUST_LOG="monitor=trace" cargo test --release --features integration-tests submit_works -- --nocapture
- name: Cleanup zombienet
if: always()
working-directory: polkadot-sdk/substrate/frame/staking-async/runtimes/papi-tests
run: |
just killall
- name: Create an issue on failure
if: failure()
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAILED_WORKFLOW_RUN_URL: https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks/${{ github.run_id }}
with:
# Use this issue template:
filename: .github/issue_templates/nightly_run_failed.md
# Update existing issue if found; hopefully will make it clearer
# that it is still an issue:
update_existing: true
# Look for new *open* issues in this search (we want to
# create a new one if we only find closed versions):
search_existing: open
- name: Notify daily integration tests failure
if: failure()
uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3
with:
room_id: ${{ matrix.channel.room }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
server: m.parity.io
message: |
@room Daily integration tests failed https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks/${{ github.run_id }}