2023-01-03 15:23:09 +00:00
|
|
|
name: Run spec tests and linter
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: zsh {0}
|
|
|
|
|
|
|
|
env:
|
|
|
|
TEST_PRESET_TYPE: "minimal"
|
|
|
|
|
2023-06-22 15:19:36 +00:00
|
|
|
on:
|
2023-01-03 15:23:09 +00:00
|
|
|
push:
|
2023-07-05 15:21:14 +00:00
|
|
|
branches:
|
2024-02-16 04:29:00 +00:00
|
|
|
- dev
|
2023-07-05 15:21:14 +00:00
|
|
|
- master
|
2024-02-16 04:29:00 +00:00
|
|
|
pull_request:
|
2023-01-03 15:23:09 +00:00
|
|
|
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:
|
|
|
|
table_of_contents:
|
2024-05-07 08:34:25 +00:00
|
|
|
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
|
2023-01-03 15:23:09 +00:00
|
|
|
steps:
|
2024-05-07 08:34:25 +00:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: '20'
|
|
|
|
cache: ''
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: Check table of contents
|
2024-05-07 08:34:25 +00:00
|
|
|
run: npm install -g doctoc@2.2.0 && make check_toc
|
2023-01-03 15:23:09 +00:00
|
|
|
|
|
|
|
codespell:
|
2024-05-07 08:34:25 +00:00
|
|
|
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
|
2023-01-03 15:23:09 +00:00
|
|
|
steps:
|
2024-05-07 08:34:25 +00:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
2024-08-21 18:15:57 +00:00
|
|
|
python-version: '3.12.4'
|
2024-05-07 08:34:25 +00:00
|
|
|
cache: ''
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: Check codespell
|
2024-05-07 08:34:25 +00:00
|
|
|
run: make codespell
|
2023-01-03 15:23:09 +00:00
|
|
|
|
|
|
|
lint:
|
2024-05-07 08:34:25 +00:00
|
|
|
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
|
2023-01-03 15:23:09 +00:00
|
|
|
steps:
|
2024-05-07 08:34:25 +00:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
2024-08-21 18:15:57 +00:00
|
|
|
- name: Setup Rust for dependencies
|
|
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
2024-05-07 08:34:25 +00:00
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
2024-08-21 18:15:57 +00:00
|
|
|
python-version: '3.12.4'
|
2024-05-07 08:34:25 +00:00
|
|
|
cache: ''
|
2023-01-10 09:23:04 +00:00
|
|
|
- name: Install pyspec requirements
|
|
|
|
run: make install_test
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: Run linter for pyspec
|
|
|
|
run: make lint
|
|
|
|
- name: Run linter for test generators
|
|
|
|
run: make lint_generators
|
|
|
|
|
|
|
|
pyspec-tests:
|
2024-05-07 08:34:25 +00:00
|
|
|
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
|
|
|
|
needs: [lint,codespell,table_of_contents]
|
2023-01-03 15:23:09 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-16 01:45:40 +00:00
|
|
|
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "whisk", "eip7594"]
|
2023-01-03 15:23:09 +00:00
|
|
|
steps:
|
2024-05-07 08:34:25 +00:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
2024-08-21 18:15:57 +00:00
|
|
|
- name: Setup Rust for dependencies
|
|
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
2024-05-07 08:34:25 +00:00
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
2024-08-21 18:15:57 +00:00
|
|
|
python-version: '3.12.4'
|
2024-05-07 08:34:25 +00:00
|
|
|
cache: ''
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: set TEST_PRESET_TYPE
|
2024-02-16 04:29:00 +00:00
|
|
|
if: github.event.inputs.test_preset_type != ''
|
2023-01-03 15:23:09 +00:00
|
|
|
run: |
|
|
|
|
echo "spec_test_preset_type=${{ github.event.inputs.test_preset_type || env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
|
|
|
|
- name: set TEST_PRESET_TYPE
|
|
|
|
if: ${{ (github.event_name == 'push' && github.ref_name != 'master') || github.event_name == 'pull_request' }}
|
|
|
|
run: |
|
2024-02-16 04:29:00 +00:00
|
|
|
echo "spec_test_preset_type=${{ env.TEST_PRESET_TYPE}}" >> $GITHUB_ENV
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: set TEST_PRESET_TYPE
|
|
|
|
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
|
|
|
|
run: |
|
2024-02-16 04:29:00 +00:00
|
|
|
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: set TEST_PRESET_TYPE
|
|
|
|
if: github.event.schedule=='0 0 * * *'
|
|
|
|
run: |
|
|
|
|
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
|
|
|
|
- name: Install pyspec requirements
|
|
|
|
run: make install_test
|
|
|
|
- name: test-${{ matrix.version }}
|
|
|
|
run: make citest fork=${{ matrix.version }} TEST_PRESET_TYPE=${{env.spec_test_preset_type}}
|
2024-05-07 08:34:25 +00:00
|
|
|
- uses: actions/upload-artifact@v4
|
2023-01-03 15:23:09 +00:00
|
|
|
if: always()
|
|
|
|
with:
|
2024-05-07 08:34:25 +00:00
|
|
|
name: test-reports-${{ matrix.version }}
|
2023-01-03 15:23:09 +00:00
|
|
|
path: tests/core/pyspec/test-reports
|