Skip to content

Commit

Permalink
Merge branch 'main' into eip1153_coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega authored May 31, 2024
2 parents 1fa919e + c6152f0 commit 394608e
Show file tree
Hide file tree
Showing 182 changed files with 14,488 additions and 522 deletions.
34 changes: 22 additions & 12 deletions .github/actions/build-evm/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,41 @@ inputs:
outputs:
impl:
description: "Implementation of EVM binary to build"
value: ${{ steps.evm-config-reader.outputs.impl }}
value: ${{ steps.config-evm-reader.outputs.impl }}
repo:
description: "Repository to use to build the EVM binary"
value: ${{ steps.evm-config-reader.outputs.repo }}
value: ${{ steps.config-evm-reader.outputs.repo }}
ref:
description: "Reference to branch, commit, or tag to use to build the EVM binary"
value: ${{ steps.evm-config-reader.outputs.ref }}
value: ${{ steps.config-evm-reader.outputs.ref }}
evm-bin:
description: "Binary name of the evm tool to use"
value: ${{ steps.config-evm-reader.outputs.evm-bin }}
runs:
using: "composite"
steps:
- name: Get the selected EVM version from the evm-config.yaml
id: evm-config-reader
- name: Get the selected EVM version from the configs/evm.yaml
id: config-evm-reader
shell: bash
run: |
awk "/^${{ inputs.type }}:/{flag=1; next} /^[[:alnum:]]/{flag=0} flag" ./evm-config.yaml \
awk "/^${{ inputs.type }}:/{flag=1; next} /^[[:alnum:]]/{flag=0} flag" ./configs/evm.yaml \
| sed 's/ //g' | sed 's/:/=/g' >> "$GITHUB_OUTPUT"
- name: Print Variables for the selected EVM type
shell: bash
run: |
echo "Implementation: ${{ steps.evm-config-reader.outputs.impl }}"
echo "Repository: ${{ steps.evm-config-reader.outputs.repo }}"
echo "Reference: ${{ steps.evm-config-reader.outputs.ref }}"
echo "Implementation: ${{ steps.config-evm-reader.outputs.impl }}"
echo "Repository: ${{ steps.config-evm-reader.outputs.repo }}"
echo "Reference: ${{ steps.config-evm-reader.outputs.ref }}"
echo "EVM Binary: ${{ steps.config-evm-reader.outputs.evm-bin }}"
- name: Build the EVM using Geth action
if: steps.evm-config-reader.outputs.impl == 'geth'
if: steps.config-evm-reader.outputs.impl == 'geth'
uses: ./.github/actions/build-geth-evm
with:
repo: ${{ steps.evm-config-reader.outputs.repo }}
ref: ${{ steps.evm-config-reader.outputs.ref }}
repo: ${{ steps.config-evm-reader.outputs.repo }}
ref: ${{ steps.config-evm-reader.outputs.ref }}
- name: Build the EVM using EVMONE action
if: steps.config-evm-reader.outputs.impl == 'evmone'
uses: ./.github/actions/build-evmone-evm
with:
repo: ${{ steps.config-evm-reader.outputs.repo }}
ref: ${{ steps.config-evm-reader.outputs.ref }}
31 changes: 31 additions & 0 deletions .github/actions/build-evmone-evm/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Build evmone EVM'
description: 'Builds the evmone EVM binary'
inputs:
repo:
description: 'Source repository to use to build the EVM binary'
required: true
default: 'ethereum/evmone'
ref:
description: 'Reference to branch, commit, or tag to use to build the EVM binary'
required: true
default: 'master'
runs:
using: "composite"
steps:
- name: Checkout evmone
uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }}
path: evmone
submodules: true
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
- name: Build evmone binary
shell: bash
run: |
mkdir -p $GITHUB_WORKSPACE/bin
cd $GITHUB_WORKSPACE/evmone
cmake -S . -B build -DEVMONE_TESTING=ON
cmake --build build --parallel
echo $GITHUB_WORKSPACE/evmone/build/bin/ >> $GITHUB_PATH
54 changes: 54 additions & 0 deletions .github/actions/build-fixtures/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Package Fixtures
inputs:
name:
description: 'Name of the fixture package'
required: true
runs:
using: "composite"
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install yq
shell: bash
run: |
pip install yq
- name: Extract fixture properties
id: properties
shell: bash
run: |
yq -r --arg feature "${{ inputs.name }}" '.[$feature] | to_entries | map("\(.key)=\(.value)")[]' ./configs/feature.yaml >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/build-evm
id: evm-builder
with:
type: ${{ steps.properties.outputs.evm-type }}
- name: Install solc compiler
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then PLATFORM="linux-amd64"; else PLATFORM="macosx-amd64"; fi
RELEASE_NAME=$(curl https://binaries.soliditylang.org/${PLATFORM}/list.json | jq -r --arg SOLC_VERSION "${{ steps.properties.outputs.solc }}" '.releases[$SOLC_VERSION]')
wget -O $GITHUB_WORKSPACE/bin/solc https://binaries.soliditylang.org/${PLATFORM}/$RELEASE_NAME
chmod a+x $GITHUB_WORKSPACE/bin/solc
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH
- name: Run fixtures fill
shell: bash
run: |
pip install --upgrade pip
python -m venv env
source env/bin/activate
pip install -e .
fill -n auto --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }}
- name: Create fixtures info file
shell: bash
run: |
echo -e "ref: $GITHUB_REF \ncommit: $GITHUB_SHA\nbuild: $(date +"%Y-%m-%dT%H:%M:%SZ")" \
> fixtures/info.txt
- name: Tar fixtures output
shell: bash
run: |
tar -czvf fixtures_${{ inputs.name }}.tar.gz ./fixtures
- uses: actions/upload-artifact@v4
with:
name: fixtures_${{ inputs.name }}
path: fixtures_${{ inputs.name }}.tar.gz
4 changes: 2 additions & 2 deletions .github/actions/build-geth-evm/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ runs:
using: "composite"
steps:
- name: Checkout go-ethereum
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }}
path: go-ethereum
- name: Setup golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.golang }}
cache-dependency-path: go-ethereum/go.sum
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:

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

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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs_tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:

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

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

Expand Down
68 changes: 18 additions & 50 deletions .github/workflows/fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,77 +5,45 @@ on:
branches:
- main
tags:
- 'v*'
- 'v[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:

jobs:
features:
runs-on: ubuntu-latest
outputs:
features: ${{ steps.parse.outputs.features }}
steps:
- uses: actions/checkout@v4
- name: Get names from configs/feature.yaml
id: parse
shell: bash
run: |
echo "features=$(grep -Po "^[0-9a-zA-Z_\-]+" ./configs/feature.yaml | jq -R . | jq -cs .)" >> "$GITHUB_OUTPUT"
build:
needs: features
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: 'fixtures'
evm-type: 'main'
fill-params: ''
solc: '0.8.21'
python: '3.11'
# - name: 'fixtures_develop'
# evm-type: 'develop'
# fill-params: '--until=Prague'
# solc: '0.8.21'
# python: '3.11'
name: ${{ fromJson(needs.features.outputs.features) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/build-evm
id: evm-builder
with:
type: ${{ matrix.evm-type }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install solc compiler
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then PLATFORM="linux-amd64"; else PLATFORM="macosx-amd64"; fi
RELEASE_NAME=$(curl https://binaries.soliditylang.org/${PLATFORM}/list.json | jq -r --arg SOLC_VERSION "${{ matrix.solc }}" '.releases[$SOLC_VERSION]')
wget -O $GITHUB_WORKSPACE/bin/solc https://binaries.soliditylang.org/${PLATFORM}/$RELEASE_NAME
chmod a+x $GITHUB_WORKSPACE/bin/solc
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH
- name: Run fixtures fill
shell: bash
run: |
pip install --upgrade pip
python -m venv env
source env/bin/activate
pip install -e .
fill ${{ matrix.fill-params }}
- name: Create fixtures info file
shell: bash
run: |
echo -e "ref: $GITHUB_REF \ncommit: $GITHUB_SHA\nbuild: $(date +"%Y-%m-%dT%H:%M:%SZ")" \
> fixtures/info.txt
- name: Tar fixtures output
shell: bash
run: |
tar -czvf ${{ matrix.name }}.tar.gz ./fixtures
- uses: actions/upload-artifact@v3
- uses: ./.github/actions/build-fixtures
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}.tar.gz
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: .
- name: Draft Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: './**'
draft: true
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/fixtures_feature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Package Fixtures for a feature

on:
push:
branches:
- main
tags:
- '*@v*'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Get feature name
id: feature-name
shell: bash
run: |
echo name=${GITHUB_REF_NAME//@*/} >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/build-fixtures
with:
name: ${{ steps.feature-name.outputs.name }}
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: .
- name: Draft Pre-release
uses: softprops/action-gh-release@v2
with:
files: './**'
draft: true
prerelease: true
generate_release_notes: true
fail_on_unmatched_files: true
22 changes: 14 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,39 @@ jobs:
- os: ubuntu-latest
python: '3.10'
solc: '0.8.20'
evm-type: 'main'
evm-type: 'stable'
tox-cmd: 'tox run-parallel --parallel-no-spinner'
- os: ubuntu-latest
python: '3.12'
solc: '0.8.23'
evm-type: 'main'
evm-type: 'stable'
tox-cmd: 'tox run-parallel --parallel-no-spinner'
- os: ubuntu-latest
python: '3.11'
solc: '0.8.21'
evm-type: 'main' # 'develop'
tox-cmd: 'tox run-parallel --parallel-no-spinner' # 'tox -e tests-develop'
evm-type: 'develop'
tox-cmd: 'tox -e tests-develop'
# Disabled to not be gated by evmone implementation
# - os: ubuntu-latest
# python: '3.11'
# solc: '0.8.21'
# evm-type: 'eip7692'
# tox-cmd: 'tox -e tests-eip7692'
- os: macos-latest
python: '3.11'
solc: '0.8.22'
evm-type: 'main'
evm-type: 'stable'
tox-cmd: 'tox run-parallel --parallel-no-spinner'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/build-evm
id: evm-builder
with:
type: ${{ matrix.evm-type }}
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
Expand All @@ -62,7 +68,7 @@ jobs:
run: pip install tox
- name: Run Tox (CPython)
run: ${{ matrix.tox-cmd }}
- uses: DavidAnson/markdownlint-cli2-action@v11
- uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: |
README.md
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ _readthedocs
site
venv-docs/
.pyspelling_en.dict

# cached fixture downloads (consume)
cached_downloads/
# pytest report
assets
*.html
Loading

0 comments on commit 394608e

Please sign in to comment.