Skip to content

Commit e8cadfb

Browse files
enhance(ci): add fixture workflows for test releases (#1608)
Co-authored-by: danceratopz <[email protected]>
1 parent 73571dd commit e8cadfb

File tree

15 files changed

+589
-2
lines changed

15 files changed

+589
-2
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: 'Build EVM'
2+
description: 'Resolves and builds the requested EVM binary by name'
3+
inputs:
4+
type:
5+
description: 'Type of EVM binary to build'
6+
required: true
7+
default: 'main'
8+
outputs:
9+
impl:
10+
description: "Implementation of EVM binary to build"
11+
value: ${{ steps.config-evm-reader.outputs.impl }}
12+
repo:
13+
description: "Repository to use to build the EVM binary"
14+
value: ${{ steps.config-evm-reader.outputs.repo }}
15+
ref:
16+
description: "Reference to branch, commit, or tag to use to build the EVM binary"
17+
value: ${{ steps.config-evm-reader.outputs.ref }}
18+
evm-bin:
19+
description: "Binary name of the evm tool to use"
20+
value: ${{ steps.config-evm-impl-config-reader.outputs.evm-bin }}
21+
x-dist:
22+
description: "Binary name of the evm tool to use"
23+
value: ${{ steps.config-evm-impl-config-reader.outputs.x-dist }}
24+
runs:
25+
using: "composite"
26+
steps:
27+
- name: Get the selected EVM version from the .github/configs/evm.yaml
28+
id: config-evm-reader
29+
shell: bash
30+
run: |
31+
awk "/^${{ inputs.type }}:/{flag=1; next} /^[[:alnum:]]/{flag=0} flag" ./.github/configs/evm.yaml \
32+
| sed 's/ //g' | sed 's/:/=/g' >> "$GITHUB_OUTPUT"
33+
- name: Get the EVM implementation configuration from .github/configs/evm-impl-config.yaml
34+
id: config-evm-impl-config-reader
35+
shell: bash
36+
run: |
37+
awk "/^${{ steps.config-evm-reader.outputs.impl }}:/{flag=1; next} /^[[:alnum:]]/{flag=0} flag" ./.github/configs/evm-impl.yaml \
38+
| sed 's/ //g' | sed 's/:/=/g' >> "$GITHUB_OUTPUT"
39+
- name: Print Variables for the selected EVM type
40+
shell: bash
41+
run: |
42+
echo "Implementation: ${{ steps.config-evm-reader.outputs.impl }}"
43+
echo "Repository: ${{ steps.config-evm-reader.outputs.repo }}"
44+
echo "Reference: ${{ steps.config-evm-reader.outputs.ref }}"
45+
echo "EVM Binary: ${{ steps.config-evm-impl-config-reader.outputs.evm-bin }}"
46+
echo "X-Dist parameter: ${{ steps.config-evm-impl-config-reader.outputs.x-dist }}"
47+
- name: Skip building for EELS
48+
if: steps.config-evm-reader.outputs.impl == 'eels'
49+
shell: bash
50+
run: echo "Skipping build for EELS"
51+
- name: Build the EVM using Geth action
52+
if: steps.config-evm-reader.outputs.impl == 'geth'
53+
uses: ./.github/actions/build-evm-client/geth
54+
with:
55+
repo: ${{ steps.config-evm-reader.outputs.repo }}
56+
ref: ${{ steps.config-evm-reader.outputs.ref }}
57+
- name: Build the EVM using EVMONE action
58+
if: steps.config-evm-reader.outputs.impl == 'evmone'
59+
uses: ./.github/actions/build-evm-client/evmone
60+
with:
61+
repo: ${{ steps.config-evm-reader.outputs.repo }}
62+
ref: ${{ steps.config-evm-reader.outputs.ref }}
63+
# `targets` in the evm.yaml must be an inline array to not interfere with `config-evm-reader`'s parsing
64+
targets: ${{ join(fromJSON(steps.config-evm-reader.outputs.targets), ' ') }}
65+
- name: Build the EVM using Besu action
66+
if: steps.config-evm-reader.outputs.impl == 'besu'
67+
uses: ./.github/actions/build-evm-client/besu
68+
with:
69+
repo: ${{ steps.config-evm-reader.outputs.repo }}
70+
ref: ${{ steps.config-evm-reader.outputs.ref }}
71+
- name: Build the EVM using EthJS action
72+
if: steps.config-evm-reader.outputs.impl == 'ethjs'
73+
uses: ./.github/actions/build-evm-client/ethjs
74+
with:
75+
repo: ${{ steps.config-evm-reader.outputs.repo }}
76+
ref: ${{ steps.config-evm-reader.outputs.ref }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Build Besu EVM'
2+
description: 'Builds the Besu EVM binary'
3+
inputs:
4+
repo:
5+
description: 'Source repository to use to build the EVM binary'
6+
required: true
7+
default: 'hyperledger/besu'
8+
ref:
9+
description: 'Reference to branch, commit, or tag to use to build the EVM binary'
10+
required: true
11+
default: 'main'
12+
java:
13+
description: 'Java version to use to build Besu'
14+
required: false
15+
default: '21'
16+
java-distro:
17+
description: 'Java distribution to use to build Besu'
18+
required: false
19+
default: 'temurin'
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Checkout Besu
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
25+
with:
26+
repository: ${{ inputs.repo }}
27+
ref: ${{ inputs.ref }}
28+
path: besu
29+
- name: Setup Java
30+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
31+
with:
32+
java-version: ${{ inputs.java }}
33+
distribution: ${{ inputs.java-distro }}
34+
cache: 'gradle'
35+
- name: Build evm cmd
36+
shell: bash
37+
run: |
38+
cd $GITHUB_WORKSPACE/besu
39+
./gradlew installDist
40+
echo $GITHUB_WORKSPACE/besu/build/install/besu/bin/ >> $GITHUB_PATH
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'Build EthereumJS monorepo'
2+
description: 'Builds the EthereumJS monorepo'
3+
inputs:
4+
repo:
5+
description: 'Source repository to use to build EthereumJS'
6+
required: true
7+
default: 'ethereumjs/ethereumjs-monorepo'
8+
ref:
9+
description: 'Reference to branch, commit, or tag to use to build EthereumJS'
10+
required: true
11+
default: 'master'
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Checkout EthereumJS monorepo
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
17+
with:
18+
repository: ${{ inputs.repo }}
19+
ref: ${{ inputs.ref }}
20+
path: ethereumjs
21+
22+
- name: Setup node
23+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e
24+
with:
25+
node-version: 18
26+
27+
- name: Build monorepo
28+
shell: bash
29+
run: |
30+
cd $GITHUB_WORKSPACE/ethereumjs
31+
npm ci
32+
33+
- name: Add t8ntool to $PATH
34+
shell: bash
35+
run: |
36+
echo $GITHUB_WORKSPACE/ethereumjs/packages/vm/test/t8n/ >> $GITHUB_PATH
37+
echo $GITHUB_WORKSPACE/ethereumjs/node_modules/.bin >> $GITHUB_PATH
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Build evmone EVM'
2+
description: 'Builds the evmone EVM binary'
3+
inputs:
4+
repo:
5+
description: 'Source repository to use to build the EVM binary'
6+
required: true
7+
default: 'ethereum/evmone'
8+
ref:
9+
description: 'Reference to branch, commit, or tag to use to build the EVM binary'
10+
required: true
11+
default: 'master'
12+
targets:
13+
description: 'Which targets to build from evmone repo'
14+
required: false
15+
default: 'all'
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: Checkout evmone
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
21+
with:
22+
repository: ${{ inputs.repo }}
23+
ref: ${{ inputs.ref }}
24+
path: evmone
25+
submodules: true
26+
- name: Setup cmake
27+
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be
28+
with:
29+
cmake-version: '3.x'
30+
- name: "Install GMP Linux"
31+
if: runner.os == 'Linux'
32+
shell: bash
33+
run: sudo apt-get -q update && sudo apt-get -qy install libgmp-dev
34+
- name: Install GMP macOS
35+
if: runner.os == 'macOS'
36+
shell: bash
37+
run: |
38+
brew update && brew install gmp
39+
- name: Build evmone binary
40+
shell: bash
41+
run: |
42+
mkdir -p $GITHUB_WORKSPACE/bin
43+
cd $GITHUB_WORKSPACE/evmone
44+
cmake -S . -B build -DEVMONE_TESTING=ON -DEVMONE_PRECOMPILES_SILKPRE=1
45+
cmake --build build --parallel --target ${{ inputs.targets }}
46+
echo $GITHUB_WORKSPACE/evmone/build/bin/ >> $GITHUB_PATH
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Build Go-Ethereum EVM'
2+
description: 'Builds the Go-Ethereum EVM binary'
3+
inputs:
4+
repo:
5+
description: 'Source repository to use to build the EVM binary'
6+
required: true
7+
default: 'ethereum/go-ethereum'
8+
ref:
9+
description: 'Reference to branch, commit, or tag to use to build the EVM binary'
10+
required: true
11+
default: 'master'
12+
golang:
13+
description: 'Golang version to use to build Geth'
14+
required: false
15+
default: '1.21.x'
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: Checkout go-ethereum
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
21+
with:
22+
repository: ${{ inputs.repo }}
23+
ref: ${{ inputs.ref }}
24+
path: go-ethereum
25+
- name: Setup golang
26+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
27+
with:
28+
go-version: ${{ inputs.golang }}
29+
cache-dependency-path: go-ethereum/go.sum
30+
- name: Build evm cmd
31+
shell: bash
32+
run: |
33+
mkdir -p $GITHUB_WORKSPACE/bin
34+
cd $GITHUB_WORKSPACE/go-ethereum/cmd/evm
35+
go build .
36+
echo $GITHUB_WORKSPACE/go-ethereum/cmd/evm >> $GITHUB_PATH
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Package Fixture Release
2+
inputs:
3+
release_name:
4+
description: "Name of the fixture release"
5+
required: true
6+
uv_version:
7+
description: "Version of UV to install"
8+
required: true
9+
python_version:
10+
description: "Version of Python to install"
11+
required: true
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Install uv ${{ inputs.uv_version }} and python ${{ inputs.python_version }}
16+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
17+
with:
18+
enable-cache: false
19+
version: ${{ inputs.uv_version }}
20+
python-version: ${{ inputs.python_version }}
21+
- name: Install EEST
22+
shell: bash
23+
run: uv sync --no-progress --extra test
24+
- name: Extract fixture release properties from config
25+
id: properties
26+
shell: bash
27+
run: |
28+
echo "release_name=${{ inputs.release_name }}"
29+
uv run -q .github/scripts/get_release_props.py ${{ inputs.release_name }} >> "$GITHUB_OUTPUT"
30+
- uses: ./.github/actions/build-evm-base
31+
id: evm-builder
32+
with:
33+
type: ${{ steps.properties.outputs.evm-type }}
34+
- name: Generate fixtures using fill
35+
shell: bash
36+
run: |
37+
if [ "${{ steps.evm-builder.outputs.impl }}" = "eels" ]; then
38+
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.release_name }}.tar.gz --build-name ${{ inputs.release_name }}
39+
else
40+
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.release_name }}.tar.gz --build-name ${{ inputs.release_name }}
41+
fi
42+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
43+
with:
44+
name: fixtures_${{ inputs.release_name }}
45+
path: fixtures_${{ inputs.release_name }}.tar.gz
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Fetch and Install Binary"
2+
description: "Downloads a binary from a GitHub release, verifies its checksum, and installs it to PATH. Only works for Linux."
3+
inputs:
4+
version:
5+
description: "Release version (e.g., v0.8.24)"
6+
required: true
7+
repo_owner:
8+
description: "GitHub repository owner"
9+
required: true
10+
repo_name:
11+
description: "GitHub repository name"
12+
required: true
13+
remote_name:
14+
description: "Binary filename in the release"
15+
required: true
16+
binary_name:
17+
description: "Name to install the binary as"
18+
required: true
19+
expected_sha256:
20+
description: "Expected SHA256 checksum"
21+
required: true
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: Download binary
26+
shell: bash
27+
run: |
28+
curl -sSL "https://github.com/${{ inputs.repo_owner }}/${{ inputs.repo_name }}/releases/download/${{ inputs.version }}/${{ inputs.remote_name }}" -o ./${{ inputs.binary_name }}
29+
echo "${{ inputs.expected_sha256 }} ${{ inputs.binary_name }}" | sha256sum -c -
30+
sudo mv ./${{ inputs.binary_name }} /usr/local/bin/${{ inputs.binary_name }}
31+
sudo chmod +x /usr/local/bin/${{ inputs.binary_name }}

.github/configs/evm-impl.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
eels:
2+
evm-bin: null
3+
x-dist: auto
4+
geth:
5+
evm-bin: evm
6+
x-dist: auto
7+
evmone:
8+
evm-bin: evmone-t8n
9+
x-dist: auto
10+
besu:
11+
evm-bin: evmtool
12+
x-dist: 0
13+
ethjs:
14+
evm-bin: ethereumjs-t8ntool.sh
15+
x-dist: auto

.github/configs/evm.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
stable:
2+
impl: eels
3+
repo: null
4+
ref: null
5+
develop:
6+
impl: eels
7+
repo: null
8+
ref: null
9+
static:
10+
impl: evmone
11+
repo: ethereum/evmone
12+
ref: master
13+
targets: ["evmone-t8n"]
14+
benchmark:
15+
impl: evmone
16+
repo: ethereum/evmone
17+
ref: master
18+
targets: ["evmone-t8n"]

.github/configs/feature.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Unless filling for special features, all features should fill for previous forks (starting from Frontier) too
2+
stable:
3+
evm-type: stable
4+
fill-params: --until=Prague --fill-static-tests --ignore=tests/static/state_tests/stQuadraticComplexityTest
5+
6+
develop:
7+
evm-type: develop
8+
# TODO: Fix BPO filling.
9+
# fill-params: --until=BPO4 --fill-static-tests --ignore=tests/static/state_tests/stQuadraticComplexityTest
10+
fill-params: --until=Osaka --fill-static-tests --ignore=tests/static/state_tests/stQuadraticComplexityTest -k "not BPO"
11+
12+
benchmark:
13+
evm-type: benchmark
14+
fill-params: --fork=Prague --gas-benchmark-values 1,10,30,45,60,100,150 -m "benchmark and not state_test" ./tests/benchmark
15+
16+
benchmark_develop:
17+
evm-type: benchmark
18+
fill-params: --fork=Osaka --gas-benchmark-values 1,10,30,60,100,150 -m "benchmark and not state_test" ./tests/benchmark
19+
feature_only: true
20+
21+
bal:
22+
evm-type: develop
23+
fill-params: --fork=Amsterdam ./tests/amsterdam/eip7928_block_level_access_lists
24+
feature_only: true

0 commit comments

Comments
 (0)