Skip to content

Commit

Permalink
feat(ci): use astral-sh/setup-uv action and new gh vars
Browse files Browse the repository at this point in the history
The official action allows convenient specification of the python version and supports caching. The setup-uv step now makes use of the new UV_VERSION and DEFAULT_PYTHON_VERSION (where appropriate).
  • Loading branch information
danceratopz committed Jan 8, 2025
1 parent fe1ab95 commit ce24319
Showing 1 changed file with 48 additions and 30 deletions.
78 changes: 48 additions & 30 deletions .github/workflows/tox_verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ jobs:
steps:
- name: Checkout ethereum/execution-spec-tests
uses: actions/checkout@v4
- name: Install uv
uses: ./.github/actions/setup-uv
- name: Install python
run: uv python install 3.12
- name: Run tox - run ruff linter
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
version: ${{ vars.UV_VERSION }}
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
- name: Run ruff linter via tox
run: uvx --with=tox-uv tox -e lint

typecheck:
Expand All @@ -23,11 +26,14 @@ jobs:
steps:
- name: Checkout ethereum/execution-spec-tests
uses: actions/checkout@v4
- name: Install uv
uses: ./.github/actions/setup-uv
- name: Install python
run: uv python install 3.12
- name: Run tox - run mypy typechecker
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
version: ${{ vars.UV_VERSION }}
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
- name: Run mypy typechecker via tox
run: uvx --with=tox-uv tox -e typecheck

spellcheck:
Expand All @@ -36,14 +42,17 @@ jobs:
steps:
- name: Checkout ethereum/execution-spec-tests
uses: actions/checkout@v4
- name: Install uv
uses: ./.github/actions/setup-uv
- name: Install python
run: uv python install 3.12
- name: Setup Dependencies
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
version: ${{ vars.UV_VERSION }}
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
- name: Install dependencies (aspell, aspell-en)
run: |
sudo apt-get update && sudo apt-get install -y aspell aspell-en
- name: Run tox - run spellcheck with pyspelling
- name: Run spellcheck with pyspelling via tox
run: uvx --with=tox-uv tox -e spellcheck

markdownlint:
Expand All @@ -64,11 +73,14 @@ jobs:
steps:
- name: Checkout ethereum/execution-spec-tests
uses: actions/checkout@v4
- name: Install uv
uses: ./.github/actions/setup-uv
- name: Install python
run: uv python install 3.12
- name: Run tox - build html documentation with mkdocs
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
version: ${{ vars.UV_VERSION }}
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
- name: Build html documentation with mkdocs via tox
run: uvx --with=tox-uv tox -e mkdocs

pytest_framework:
Expand All @@ -95,17 +107,20 @@ jobs:
sparse-checkout: |
src/ethereum
fetch-depth: 1
- name: Install uv
uses: ./.github/actions/setup-uv
- name: Install python ${{ matrix.python }}
run: uv python install ${{ matrix.python }}
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ matrix.python }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
version: ${{ vars.UV_VERSION }}
python-version: ${{ matrix.python }}
- name: Run tox - run framework unit tests with pytest
env:
EELS_RESOLUTIONS_FILE: ${{ github.workspace }}/.github/configs/eels_resolutions.json
run: uvx --with=tox-uv tox -e pytest

tests_deployed:
name: Fill tests deployed, ${{ matrix.os }}, ${{ matrix.python }}
name: Fill tests, deployed, ${{ matrix.os }}, ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -129,10 +144,13 @@ jobs:
sparse-checkout: |
src/ethereum
fetch-depth: 1
- name: Install uv
uses: ./.github/actions/setup-uv
- name: Install Python ${{ matrix.python }}
run: uv python install ${{ matrix.python }}
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ matrix.python }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
version: ${{ vars.UV_VERSION }}
python-version: ${{ matrix.python }}
- name: Run tox - fill tests for deployed forks
env:
EELS_RESOLUTIONS_FILE: ${{ github.workspace }}/.github/configs/eels_resolutions.json
Expand Down

0 comments on commit ce24319

Please sign in to comment.