-
Notifications
You must be signed in to change notification settings - Fork 997
145 lines (136 loc) · 4.51 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Run spec tests and linter
defaults:
run:
shell: zsh {0}
env:
TEST_PRESET_TYPE: "minimal"
on:
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:
table_of_contents:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: ''
- name: Check table of contents
run: npm install -g [email protected] && make check_toc
codespell:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: ''
- name: Check codespell
run: make codespell
lint:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: ''
- name: Install pyspec requirements
run: make install_test
- name: Run linter for pyspec
run: make lint
- name: Run linter for test generators
run: make lint_generators
whitespace:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for trailing whitespace
run: |
if git grep -n '[[:blank:]]$'; then
echo "Trailing whitespace found. Please fix it."
exit 1
fi
pyspec-tests:
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
needs: [lint,codespell,table_of_contents]
strategy:
matrix:
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "whisk", "eip7594"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: ''
- 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@v4
if: always()
with:
name: test-reports-${{ matrix.version }}
path: tests/core/pyspec/test-reports
gen-modcheck:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: ''
- name: Install pyspec requirements
run: make install_test
- name: Run generators with --modcheck
run: make generate_tests modcheck=true 2>&1 | tee consensustestgen.log
- name: Check for errors
run: |
if grep -q "\[ERROR\]" consensustestgen.log; then
echo "There is an error in the log"
exit 1
fi