Skip to content

Commit

Permalink
Adds CI to generate test vectors (#3793)
Browse files Browse the repository at this point in the history
* Add support for the CI to generate the test vectors
  • Loading branch information
parithosh authored Jun 11, 2024
1 parent 6efab19 commit d4b6c0c
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/generate_vectors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Run test vector generation

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

jobs:
generate-tests:
runs-on: [self-hosted-ghr-custom, size-chungus-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: 'ethereum/consensus-specs'
path: 'consensus-specs'
ref: ${{ inputs.source_ref }}
- name: Checkout consensus-spec-tests repository
uses: actions/checkout@v4
with:
repository: 'ethereum/consensus-spec-tests'
path: 'consensus-spec-tests'
fetch-depth: 1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: ''
- name: Clean up Spec Repository
run: |
cd consensus-specs
make clean
- name: Install dependencies and generate pyspec
run: |
cd consensus-specs
make install_test
make -B pyspec
- name: Generate tests
run: |
cd consensus-specs
make -j 16 generate_tests 2>&1 | tee ../consensustestgen.log
cp -r presets/ ../consensus-spec-tests/presets
cp -r configs/ ../consensus-spec-tests/configs
find . -type d -empty -delete
- name: Archive configurations
run: |
cd consensus-spec-tests
tar -czvf general.tar.gz tests/general
tar -czvf minimal.tar.gz tests/minimal
tar -czvf mainnet.tar.gz tests/mainnet
- name: Upload general.tar.gz
uses: actions/upload-artifact@v4
with:
name: General Test Configuration
path: consensus-spec-tests/general.tar.gz
- name: Upload minimal.tar.gz
uses: actions/upload-artifact@v4
with:
name: Minimal Test Configuration
path: consensus-spec-tests/minimal.tar.gz
- name: Upload mainnet.tar.gz
uses: actions/upload-artifact@v4
with:
name: Mainnet Test Configuration
path: consensus-spec-tests/mainnet.tar.gz
- name: Upload consensustestgen
uses: actions/upload-artifact@v4
with:
name: consensustestgen.log
path: consensustestgen.log

0 comments on commit d4b6c0c

Please sign in to comment.