Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/setup-env/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Setup Environment
description: Common setup for Ethereum Spec jobs
runs:
using: "composite"
steps:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: "1.69.0"
override: true

- name: Install Tox and any other packages
shell: bash
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes build-essential pkg-config
pip install 'tox>=4.11,<5' requests

- name: Download Geth and add to $PATH
shell: bash
run: |
mkdir -p $GITHUB_WORKSPACE/bin
$GITHUB_WORKSPACE/scripts/download_geth_linux.py --dir $GITHUB_WORKSPACE/bin
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH
91 changes: 61 additions & 30 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,84 @@ on:
pull_request:

jobs:
build:
runs-on: [self-hosted-ghr, size-xl-x64]
strategy:
matrix:
py: [ "3.11", "pypy3.11" ]

static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Rust
uses: actions-rs/toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
toolchain: "1.69.0"
override: true
python-version: "3.11"
- uses: ./.github/actions/setup-env
- name: Run static checks
run: tox -e static

py3:
runs-on: ubuntu-latest
needs: static
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}

- name: Install Tox and any other packages
run: |
DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes build-essential pkg-config
pip install 'tox>=4.11,<5' requests
python-version: "3.11"
- uses: ./.github/actions/setup-env
- name: Run py3 tests
run: tox -e py3

- name: Download Geth and add to $PATH
run: |
mkdir -p $GITHUB_WORKSPACE/bin
$GITHUB_WORKSPACE/scripts/download_geth_linux.py --dir $GITHUB_WORKSPACE/bin
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH

- name: Run Tox (CPython)
if: "${{ !startsWith(matrix.py, 'pypy') }}"
run: tox -e static,py3_eest,optimized,py3

- name: Run Tox (PyPy)
if: "${{ startsWith(matrix.py, 'pypy') }}"
pypy3:
runs-on: ubuntu-latest
needs: static
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "pypy3.11"
- uses: ./.github/actions/setup-env
- name: Run pypy3 tests
run: tox -e pypy3
env:
PYPY_GC_MAX: "10G"

json_infra:
runs-on: ubuntu-latest
needs: py3
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: ./.github/actions/setup-env
- name: Run json infra tests
run: tox -e json_infra
- name: Upload coverage reports to Codecov
if: "${{ !startsWith(matrix.py, 'pypy') }}"
uses: codecov/codecov-action@v5
with:
files: .tox/coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}

optimized:
runs-on: ubuntu-latest
needs: py3
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: ./.github/actions/setup-env
- name: Run optimized tests
run: tox -e optimized
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ commands =
ethereum-spec-lint
vulture src tests vulture_whitelist.py --exclude "*/tests/fixtures/*" --ignore-names "pytest_*"

[testenv:py3]
[testenv:json_infra]
extras =
test
commands =
Expand All @@ -33,7 +33,7 @@ commands =
--basetemp="{temp_dir}/pytest" \
tests

[testenv:py3_eest]
[testenv:py3]
extras =
test
commands =
Expand Down
Loading