Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed Sep 3, 2024
2 parents 355078c + 7c30878 commit 4f1648e
Show file tree
Hide file tree
Showing 61 changed files with 5,508 additions and 1,849 deletions.
38 changes: 17 additions & 21 deletions .github/actions/build-fixtures/action.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
name: Build and Package Fixtures
name: Build and Package Fixture Release
inputs:
name:
description: 'Name of the fixture package'
release_name:
description: 'Name of the fixture release'
required: true
runs:
using: "composite"
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install yq
- name: Set up uv
uses: ./.github/actions/setup-uv
- name: Set up Python
shell: bash
run: uv python install 3.10 --no-progress
- name: Install EEST
shell: bash
run: |
pip install yq
- name: Extract fixture properties
run: uv sync --no-progress
- name: Extract fixture release properties from config
id: properties
shell: bash
run: |
yq -r --arg feature "${{ inputs.name }}" '.[$feature] | to_entries | map("\(.key)=\(.value)")[]' ./.github/configs/feature.yaml >> "$GITHUB_OUTPUT"
echo "release_name=${{ inputs.release_name }}"
uv run -q .github/scripts/get_release_props.py ${{ inputs.release_name }} >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/build-evm-base
id: evm-builder
with:
type: ${{ steps.properties.outputs.evm-type }}
- name: Run fixtures fill
- name: Generate fixtures using fill
shell: bash
run: |
pip install --upgrade pip
python -m venv env
source env/bin/activate
pip install -e .
solc-select use ${{ steps.properties.outputs.solc }} --always-install
fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.name }}.tar.gz --build-name ${{ inputs.name }}
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} --solc-version=${{ steps.properties.outputs.solc }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.release_name }}.tar.gz --build-name ${{ inputs.release_name }}
- uses: actions/upload-artifact@v4
with:
name: fixtures_${{ inputs.name }}
path: fixtures_${{ inputs.name }}.tar.gz
name: fixtures_${{ inputs.release_name }}
path: fixtures_${{ inputs.release_name }}.tar.gz
11 changes: 11 additions & 0 deletions .github/actions/setup-uv/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Setup UV'
description: 'Sets up uv with a fixed version'
runs:
using: 'composite'
steps:
- name: Install UV
shell: bash
run: |
UV_VERSION="0.4.2"
echo "Installing UV version $UV_VERSION..."
curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh
29 changes: 29 additions & 0 deletions .github/scripts/get_release_props.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "pyyaml",
# "click",
# ]
# ///

import sys

import click
import yaml

RELEASE_PROPS_FILE = './.github/configs/feature.yaml'


@click.command()
@click.argument('release', required=True)
def get_release_props(release):
"""Extracts a specific property from the YAML file for a given release."""
with open(RELEASE_PROPS_FILE) as f:
data = yaml.safe_load(f)
if release not in data:
print(f"Error: Release {release} not found in {RELEASE_PROPS_FILE}.")
sys.exit(1)
print("\n".join(f"{key}={value}" for key, value in data[release].items()))

if __name__ == "__main__":
get_release_props()
39 changes: 20 additions & 19 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Evmone Coverage Report
on:
pull_request:
paths:
- 'converted-ethereum-tests.txt' # This triggers the workflow only for changes in file.txt
- "converted-ethereum-tests.txt" # This triggers the workflow only for changes in file.txt

jobs:
evmone-coverage-diff:
Expand Down Expand Up @@ -31,26 +31,29 @@ jobs:
echo $(pwd)
echo ${{ github.workspace }}
#install pyspec deps from root repo
python3 --version
pip install --upgrade pip
python3 -m venv ./venv/
source ./venv/bin/activate
pip install -e .
solc-select use 0.8.25 --always-install
- name: Set up uv
uses: ./.github/actions/setup-uv

- name: Set up Python
run: uv python install 3.10

- name: Install EEST
run: |
uv sync --no-progress
uv run python --version
# Required to fill .py tests
- name: Build GO EVM
uses: ./.github/actions/build-evm-client/geth
id: evm-builder
with:
type: 'main'
type: "main"

- name: Build EVMONE EVM
uses: ./.github/actions/build-evm-client/evmone
id: evm-builder2
with:
type: 'main'
type: "main"

- name: Checkout ethereum/tests
uses: actions/checkout@v4
Expand All @@ -69,7 +72,6 @@ jobs:
sparse-checkout: |
Cancun/GeneralStateTests
# This command diffs the file and filters in new lines
- name: Parse converted tests from converted-ethereum-tests.txt
run: |
Expand All @@ -78,7 +80,7 @@ jobs:
files=$(echo "$lines" | grep -oP '(?<=\+).+\.json')
if [ -z "$files" ]; then
echo "Error: No new JSON files found in converted-ethereum-tests.txt"
echo "Error: No new JSON files found in converted-ethereum-tests.txt"
exit 1
fi
Expand Down Expand Up @@ -114,13 +116,12 @@ jobs:
fi
if [ $file_found -eq 0 ]; then
echo "Error: Failed to find the test file $file in test repo"
echo "Error: Failed to find the test file $file in test repo"
exit 1
fi
done
# This command diffs the .py scripts introduced by a PR
# This command diffs the .py scripts introduced by a PR
- name: Parse and fill introduced test sources
run: |
python3 -m venv ./venv/
Expand Down Expand Up @@ -153,12 +154,12 @@ jobs:
mkdir -p fixtures/eof_tests
echo "$files" | while read line; do
file=$(echo "$line" | cut -c 3-)
fill $file --until=Cancun --evm-bin evmone-t8n || true >> filloutput.log 2>&1
(fill $file --fork=CancunEIP7692 --evm-bin evmone-t8n -k eof_test || true) > >(tee -a filloutput.log filloutputEOF.log) 2>&1
uv run fill $file --until=Cancun --evm-bin evmone-t8n --solc-version=0.8.25 || true >> filloutput.log 2>&1
(uv run fill $file --fork=CancunEIP7692 --evm-bin evmone-t8n --solc-version=0.8.25 -k eof_test || true) > >(tee -a filloutput.log filloutputEOF.log) 2>&1
done
if grep -q "FAILURES" filloutput.log; then
echo "Error: failed to generate .py tests."
echo "Error: failed to generate .py tests."
exit 1
fi
if [ "${{ matrix.driver }}" = "retesteth" ] && grep -q "passed" filloutputEOF.log; then
Expand All @@ -174,7 +175,7 @@ jobs:
filesEOF=$(find fixtures/eof_tests -type f -name "*.json")
if [ -z "$filesState" ] && [ -z "$filesEOF" ]; then
echo "Error: No filled JSON fixtures found in fixtures."
exit 1
exit 1
fi
PATCH_TEST_PATH=${{ github.workspace }}/evmtest_coverage/coverage/PATCH_TESTS
Expand Down
44 changes: 19 additions & 25 deletions .github/workflows/docs_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,25 @@ on:

jobs:
deploy:
if: github.repository_owner == 'ethereum' # don't run on forks
if: github.repository_owner == 'ethereum' # don't run on forks
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{secrets.GH_ACTIONS_DEPLOY_KEY}}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[docs]
- name: Setup doc deploy
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email github-actions[bot]@users.noreply.github.com
- name: Build and deploy docs to gh-pages
run: |
mike deploy --update-aliases --push --remote origin main development
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{secrets.GH_ACTIONS_DEPLOY_KEY}}
- name: Set up uv
uses: ./.github/actions/setup-uv
- name: Set up Python
run: uv python install 3.11
- name: Install EEST and dependencies
run: uv sync --extra=docs --no-progress
- name: Setup doc deploy
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email github-actions[bot]@users.noreply.github.com
- name: Build and deploy docs to gh-pages
run: |
uv run mike deploy --update-aliases --push --remote origin main development
46 changes: 20 additions & 26 deletions .github/workflows/docs_tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,29 @@ name: Deploy Docs Tags
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10, v0.1.1a1
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10, v0.1.1a1

jobs:
deploy:
if: github.repository_owner == 'ethereum' # don't run on forks
if: github.repository_owner == 'ethereum' # don't run on forks
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{secrets.GH_ACTIONS_DEPLOY_KEY}}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[docs]
- name: Setup doc deploy
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email github-actions[bot]@users.noreply.github.com
- name: Build and deploy docs to gh-pages
run: |
mike deploy --update-aliases --push --remote origin ${{ github.ref_name }} latest
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{secrets.GH_ACTIONS_DEPLOY_KEY}}
- name: Set up uv
uses: ./.github/actions/setup-uv
- name: Set up Python
run: uv python install 3.11
- name: Install EEST and dependencies
run: uv sync --extra=docs --no-progress
- name: Setup doc deploy
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email github-actions[bot]@users.noreply.github.com
- name: Build and deploy docs to gh-pages
run: |
uv run mike deploy --update-aliases --push --remote origin ${{ github.ref_name }} latest
8 changes: 4 additions & 4 deletions .github/workflows/fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and Package Fixtures
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
- "v[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:

jobs:
Expand All @@ -30,7 +30,7 @@ jobs:
submodules: true
- uses: ./.github/actions/build-fixtures
with:
name: ${{ matrix.name }}
release_name: ${{ matrix.name }}
release:
runs-on: ubuntu-latest
needs: build
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Draft Release
uses: softprops/action-gh-release@v2
with:
files: './**'
files: "./**"
draft: true
generate_release_notes: true
fail_on_unmatched_files: true
fail_on_unmatched_files: true
8 changes: 4 additions & 4 deletions .github/workflows/fixtures_feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and Package Fixtures for a feature
on:
push:
tags:
- '*@v*'
- "*@v*"
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
submodules: true
- uses: ./.github/actions/build-fixtures
with:
name: ${{ matrix.feature }}
release_name: ${{ matrix.feature }}
release:
runs-on: ubuntu-latest
needs: build
Expand All @@ -47,8 +47,8 @@ jobs:
- name: Draft Pre-release
uses: softprops/action-gh-release@v2
with:
files: './**'
files: "./**"
draft: true
prerelease: true
generate_release_notes: true
fail_on_unmatched_files: true
fail_on_unmatched_files: true
Loading

0 comments on commit 4f1648e

Please sign in to comment.