Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Nightly mainnet tests

defaults:
run:
shell: zsh {0}

on:
workflow_dispatch:
inputs:
ref:
description: The branch, tag or SHA to checkout and build from
default: dev
type: string
required: true
schedule:
# Every day at 00:00 UTC
- cron: '0 0 * * *'

jobs:
tests:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
strategy:
fail-fast: false
matrix:
fork:
- phase0
- altair
- bellatrix
- capella
- deneb
- electra
- fulu
- eip7441
- eip7732
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: '3.12'
- name: test-${{ matrix.fork }}
run: make test preset=mainnet fork=${{ matrix.fork }}
89 changes: 31 additions & 58 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,32 @@
name: Run spec tests and linter
name: Run tests

defaults:
run:
shell: zsh {0}

env:
TEST_PRESET_TYPE: "minimal"

on:
push:
branches:
- dev
- master
branches: [dev, master]
pull_request:
workflow_dispatch:
inputs:
test_preset_type:
default: minimal
description: Type of test to run, either mainnet or minimal
type: string
required: true
schedule:
- cron: '0 0 * * *'

jobs:
lint:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Python
- name: Setup python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: '3.12.4'
cache: ''
python-version: '3.12'
cache: 'pip'
- name: Run linter for pyspec
run: |
make lint
git diff --exit-code

whitespace:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -51,56 +37,43 @@ jobs:
exit 1
fi

pyspec-tests:
tests:
needs: [lint, whitespace]
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
needs: [lint]
strategy:
matrix:
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "fulu", "eip7441", "eip7732"]
fork:
- phase0
- altair
- bellatrix
- capella
- deneb
- electra
- fulu
- eip7441
- eip7732
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
- name: Setup Python
- name: Setup python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: '3.12.4'
cache: ''
- name: set preset
if: github.event.inputs.test_preset_type != ''
run: |
echo "spec_test_preset_type=${{ github.event.inputs.test_preset_type || env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
- name: set preset
if: ${{ (github.event_name == 'push' && github.ref_name != 'master') || github.event_name == 'pull_request' }}
run: |
echo "spec_test_preset_type=${{ env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
- name: set preset
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
run: |
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
- name: set preset
if: github.event.schedule=='0 0 * * *'
run: |
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
- name: test-${{ matrix.version }}
run: make test fork=${{ matrix.version }} preset=${{ env.spec_test_preset_type }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: test-reports-${{ matrix.version }}
path: tests/core/pyspec/test-reports
python-version: '3.12'
cache: 'pip'
- name: Run pyspec tests for ${{ matrix.fork }}
run: make test preset=minimal fork=${{ matrix.fork }}

gen-modcheck:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
modcheck:
needs: [lint, whitespace]
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Python
- name: Setup python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: '3.12.4'
cache: ''
python-version: '3.12'
cache: 'pip'
- name: Run generators with --modcheck
run: make gen_all modcheck=true 2>&1 | tee consensustestgen.log
- name: Check for errors
Expand Down