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:
|
|
|
|
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:
|
2023-01-05 13:14:38 +00:00
|
|
|
preclear:
|
2023-01-03 15:23:09 +00:00
|
|
|
runs-on: self-hosted
|
|
|
|
if: always()
|
|
|
|
steps:
|
|
|
|
- name: 'Cleanup build folder'
|
|
|
|
run: |
|
|
|
|
ls -la ./
|
|
|
|
rm -rf ./* || true
|
|
|
|
rm -rf ./.??* || true
|
|
|
|
ls -la ./
|
|
|
|
|
|
|
|
table_of_contents:
|
|
|
|
runs-on: self-hosted
|
2023-01-05 13:14:38 +00:00
|
|
|
needs: preclear
|
2023-01-03 15:23:09 +00:00
|
|
|
steps:
|
2023-01-05 13:14:38 +00:00
|
|
|
- name: Checkout this repo
|
|
|
|
uses: actions/checkout@v3.2.0
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: Check table of contents
|
2023-06-14 12:29:59 +00:00
|
|
|
run: sudo npm install -g doctoc@2.2.0 && make check_toc
|
2023-01-03 15:23:09 +00:00
|
|
|
|
|
|
|
codespell:
|
|
|
|
runs-on: self-hosted
|
2023-01-05 13:14:38 +00:00
|
|
|
needs: preclear
|
2023-01-03 15:23:09 +00:00
|
|
|
steps:
|
2023-01-05 13:14:38 +00:00
|
|
|
- name: Checkout this repo
|
|
|
|
uses: actions/checkout@v3.2.0
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: Check codespell
|
|
|
|
run: pip install 'codespell<3.0.0,>=2.0.0' --user && make codespell
|
|
|
|
|
|
|
|
lint:
|
|
|
|
runs-on: self-hosted
|
2023-01-05 13:14:38 +00:00
|
|
|
needs: preclear
|
2023-01-03 15:23:09 +00:00
|
|
|
steps:
|
2023-01-05 13:14:38 +00:00
|
|
|
- name: Checkout this repo
|
|
|
|
uses: actions/checkout@v3.2.0
|
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:
|
|
|
|
runs-on: self-hosted
|
2023-01-05 13:14:38 +00:00
|
|
|
needs: [preclear,lint,codespell,table_of_contents]
|
2023-01-03 15:23:09 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-05-10 13:31:32 +00:00
|
|
|
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "eip6110", "eip7002"]
|
2023-01-03 15:23:09 +00:00
|
|
|
steps:
|
2023-01-05 13:14:38 +00:00
|
|
|
- name: Checkout this repo
|
|
|
|
uses: actions/checkout@v3.2.0
|
2023-01-03 15:23:09 +00:00
|
|
|
- name: set TEST_PRESET_TYPE
|
|
|
|
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 TEST_PRESET_TYPE
|
|
|
|
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 TEST_PRESET_TYPE
|
|
|
|
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
|
|
|
|
run: |
|
|
|
|
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
|
|
|
|
- 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}}
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: test-${{ matrix.version }}
|
|
|
|
path: tests/core/pyspec/test-reports
|
|
|
|
|
|
|
|
cleanup:
|
|
|
|
runs-on: self-hosted
|
2023-01-05 13:14:38 +00:00
|
|
|
needs: [preclear,pyspec-tests,codespell,lint,table_of_contents]
|
2023-01-03 15:23:09 +00:00
|
|
|
if: always()
|
|
|
|
steps:
|
|
|
|
- name: 'Cleanup build folder'
|
|
|
|
run: |
|
|
|
|
ls -la ./
|
|
|
|
rm -rf ./* || true
|
|
|
|
rm -rf ./.??* || true
|
|
|
|
ls -la ./
|