Skip to content

Commit ad74339

Browse files
authored
Use strategy matrix in nightly reference test action (#4991)
Generating these in parallel on a single runner is too slow. Splitting the job across multiple runners for each preset/fork combination, then joining the results together, will be faster. There hasn't been a successful run yet with the current action; it either times out or crashes to what I believe to be an out-of-memory issue. I have fixed the memory issue in the following PR, but it's still taking longer than 12 hours, despite numerous improvements. * #4987
1 parent 6318e7c commit ad74339

File tree

1 file changed

+46
-27
lines changed

1 file changed

+46
-27
lines changed

.github/workflows/nightly-pytest-reftests.yml

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,29 @@ on:
1818
type: string
1919
required: true
2020
schedule:
21-
- cron: "0 4 * * *"
21+
- cron: "0 0 * * *"
2222

2323
jobs:
2424
generate-tests:
2525
timeout-minutes: 720 # 12 hours
26-
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
26+
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
preset:
31+
- general
32+
- minimal
33+
- mainnet
34+
fork:
35+
- phase0
36+
- altair
37+
- bellatrix
38+
- capella
39+
- deneb
40+
- electra
41+
- fulu
42+
- gloas
43+
- heze
2744
steps:
2845
- name: Checkout repository
2946
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -40,35 +57,37 @@ jobs:
4057
with:
4158
enable-cache: true
4259
version: ${{ vars.UV_VERSION }}
43-
- name: Generate tests
60+
- name: Generate ${{ matrix.preset }}-${{ matrix.fork }} tests
4461
run: |
4562
cd consensus-specs
46-
set -o pipefail
47-
make test component=pyspec reftests=true 2>&1 | tee ../pytest-reftests.log
48-
- name: Archive test vectors
49-
run: |
50-
cd pytest-reftests
51-
tar -czvf general.tar.gz tests/general
52-
tar -czvf minimal.tar.gz tests/minimal
53-
tar -czvf mainnet.tar.gz tests/mainnet
54-
- name: Upload general.tar.gz
55-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
56-
with:
57-
name: pytest-reftests-general
58-
path: pytest-reftests/general.tar.gz
59-
- name: Upload minimal.tar.gz
63+
make test component=pyspec preset=${{ matrix.preset }} fork=${{ matrix.fork }} reftests=true
64+
- name: Upload reference tests
6065
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6166
with:
62-
name: pytest-reftests-minimal
63-
path: pytest-reftests/minimal.tar.gz
64-
- name: Upload mainnet.tar.gz
65-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
67+
name: pytest-reftests-${{ matrix.preset }}-${{ matrix.fork }}
68+
path: pytest-reftests/tests/${{ matrix.preset }}
69+
if-no-files-found: ignore
70+
71+
package-tests:
72+
needs: generate-tests
73+
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
74+
strategy:
75+
matrix:
76+
preset:
77+
- general
78+
- minimal
79+
- mainnet
80+
steps:
81+
- name: Download all ${{ matrix.preset }} artifacts
82+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
6683
with:
67-
name: pytest-reftests-mainnet
68-
path: pytest-reftests/mainnet.tar.gz
69-
- name: Upload pytest-reftests.log
84+
pattern: pytest-reftests-${{ matrix.preset }}-*
85+
path: tests/${{ matrix.preset }}
86+
merge-multiple: true
87+
- name: Archive ${{ matrix.preset }} reference tests
88+
run: tar -czvf ${{ matrix.preset }}.tar.gz tests/${{ matrix.preset }}
89+
- name: Upload ${{ matrix.preset }}.tar.gz
7090
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
71-
if: always()
7291
with:
73-
name: pytest-reftests.log
74-
path: pytest-reftests.log
92+
name: pytest-reftests-${{ matrix.preset }}
93+
path: ${{ matrix.preset }}.tar.gz

0 commit comments

Comments
 (0)