Skip to content

Commit a695b00

Browse files
authored
chore(ci): update and use astral-sh/setup-uv in all actions (#1409)
* style(ci): lint actions/fix-up whitespace * refactor(ci): use astral-sh/setup-uv instead of local action * chore(ci): bump astral-uv/setup-uv to latest release
1 parent ffc5558 commit a695b00

File tree

5 files changed

+84
-94
lines changed

5 files changed

+84
-94
lines changed

.github/actions/build-fixtures/action.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: Build and Package Fixture Release
22
inputs:
33
release_name:
4-
description: 'Name of the fixture release'
4+
description: "Name of the fixture release"
55
required: true
66
runs:
77
using: "composite"
88
steps:
9-
- name: Set up uv
10-
uses: ./.github/actions/setup-uv
11-
- name: Set up Python
12-
shell: bash
13-
run: uv python install 3.10 --no-progress
9+
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
10+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
11+
with:
12+
enable-cache: false
13+
version: ${{ vars.UV_VERSION }}
14+
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
1415
- name: Install EEST
1516
shell: bash
1617
run: uv sync --no-progress

.github/actions/setup-uv/action.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/coverage.yaml

Lines changed: 62 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Evmone Coverage Report
33
on:
44
pull_request:
55
paths:
6-
- 'tests/**' # This triggers the workflow for any changes in the tests folder
7-
- '!tests/prague/**' # exclude changes in 'tests/prague'
8-
- '!tests/osaka/**' # exclude changes in 'tests/osaka'
6+
- "tests/**" # This triggers the workflow for any changes in the tests folder
7+
- "!tests/prague/**" # exclude changes in 'tests/prague'
8+
- "!tests/osaka/**" # exclude changes in 'tests/osaka'
99

1010
jobs:
1111
evmone-coverage-diff:
@@ -23,7 +23,6 @@ jobs:
2323
echo "Node Version: $(node -v)"
2424
echo "NPM Version: $(npm -v)"
2525
26-
2726
- name: Get all changed python files in tests/ and changes to coverted-ethereum-tests.txt
2827
id: changed-tests
2928
uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c
@@ -71,13 +70,13 @@ jobs:
7170
echo $(pwd)
7271
echo ${{ github.workspace }}
7372
74-
- name: Set up uv
75-
if: steps.changed-tests.outputs.tests_any_changed == 'true'
76-
uses: ./.github/actions/setup-uv
77-
78-
- name: Set up Python
73+
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
7974
if: steps.changed-tests.outputs.tests_any_changed == 'true'
80-
run: uv python install 3.10
75+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
76+
with:
77+
enable-cache: false
78+
version: ${{ vars.UV_VERSION }}
79+
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
8180

8281
- name: Install EEST
8382
if: steps.changed-tests.outputs.tests_any_changed == 'true'
@@ -105,7 +104,7 @@ jobs:
105104
106105
- name: Checkout ethereum/legacytests
107106
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
108-
if: steps.changed-tests.outputs.tests_any_changed == 'true'
107+
if: steps.changed-tests.outputs.tests_any_changed == 'true'
109108
with:
110109
repository: ethereum/legacytests
111110
path: legacytestpath
@@ -133,7 +132,6 @@ jobs:
133132
echo "----------------"
134133
echo "Discovered existing json tests that will be BASE files:"
135134
136-
137135
BASE_TESTS_PATH=${{ github.workspace }}/evmtest_coverage/coverage/BASE_TESTS
138136
mkdir -p $BASE_TESTS_PATH
139137
for file in $files; do
@@ -208,64 +206,64 @@ jobs:
208206
env:
209207
CHANGED_TEST_FILES: ${{ steps.changed-tests.outputs.tests_all_modified_files }}
210208
run: |
211-
echo "--------------------"
212-
echo "converted-ethereum-tests.txt seem untouched, try to fill pre-patched version of .py files:"
209+
echo "--------------------"
210+
echo "converted-ethereum-tests.txt seem untouched, try to fill pre-patched version of .py files:"
213211
214-
source $GITHUB_ENV
215-
files=$(echo "$CHANGED_TEST_FILES" | tr ',' '\n')
212+
source $GITHUB_ENV
213+
files=$(echo "$CHANGED_TEST_FILES" | tr ',' '\n')
216214
217-
git checkout main
218-
PREV_COMMIT=$(git rev-parse HEAD)
219-
echo "Checkout head $PREV_COMMIT"
215+
git checkout main
216+
PREV_COMMIT=$(git rev-parse HEAD)
217+
echo "Checkout head $PREV_COMMIT"
220218
221-
# Take only those files that exist in the filesystem (ignore newly created files)
222-
files_fixed=$(echo "$files" | tr ' ' '\n' | while read file; do
223-
if [ -f "$file" ]; then
224-
echo "$file"
225-
fi
226-
done | tr '\n' ' ')
227-
228-
echo "Select files that were changed and exist on the main branch:"
229-
echo $files_fixed
230-
231-
rm -r fixtures
232-
rm filloutput.log
233-
mkdir -p fixtures/blockchain_tests
234-
mkdir -p fixtures/state_tests
235-
mkdir -p fixtures/eof_tests
236-
237-
if [ -n "$files_fixed" ]; then
238-
echo "uv run fill $files_fixed --until=Cancun --evm-bin evmone-t8n >> filloutput.log 2>&1"
239-
uv run fill $files_fixed --until=Cancun --evm-bin evmone-t8n > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
240-
241-
if grep -q "FAILURES" filloutput.log; then
242-
echo "Error: failed to generate .py tests from before the PR."
243-
exit 1
244-
fi
245-
246-
if grep -q "ERROR collecting test session" filloutput.log; then
247-
echo "Error: failed to generate .py tests from before the PR."
248-
exit 1
249-
fi
250-
else
251-
echo "No tests affected from before the patch!"
219+
# Take only those files that exist in the filesystem (ignore newly created files)
220+
files_fixed=$(echo "$files" | tr ' ' '\n' | while read file; do
221+
if [ -f "$file" ]; then
222+
echo "$file"
252223
fi
224+
done | tr '\n' ' ')
253225
254-
filesBlock=$(find fixtures/blockchain_tests -type f -name "*.json")
255-
filesState=$(find fixtures/state_tests -type f -name "*.json")
256-
filesEOF=$(find fixtures/eof_tests -type f -name "*.json")
226+
echo "Select files that were changed and exist on the main branch:"
227+
echo $files_fixed
257228
258-
BASE_TEST_PATH=${{ github.workspace }}/evmtest_coverage/coverage/BASE_TESTS
259-
mkdir -p $BASE_TEST_PATH
229+
rm -r fixtures
230+
rm filloutput.log
231+
mkdir -p fixtures/blockchain_tests
232+
mkdir -p fixtures/state_tests
233+
mkdir -p fixtures/eof_tests
234+
235+
if [ -n "$files_fixed" ]; then
236+
echo "uv run fill $files_fixed --until=Cancun --evm-bin evmone-t8n >> filloutput.log 2>&1"
237+
uv run fill $files_fixed --until=Cancun --evm-bin evmone-t8n > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
260238
261-
find fixtures/blockchain_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
262-
find fixtures/state_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
263-
find fixtures/eof_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
264-
for file in $BASE_TEST_PATH/*.json; do
265-
if [ -e "$file" ]; then
266-
mv "$file" "${file%.json}_$PREV_COMMIT.json"
267-
fi
268-
done
239+
if grep -q "FAILURES" filloutput.log; then
240+
echo "Error: failed to generate .py tests from before the PR."
241+
exit 1
242+
fi
243+
244+
if grep -q "ERROR collecting test session" filloutput.log; then
245+
echo "Error: failed to generate .py tests from before the PR."
246+
exit 1
247+
fi
248+
else
249+
echo "No tests affected from before the patch!"
250+
fi
251+
252+
filesBlock=$(find fixtures/blockchain_tests -type f -name "*.json")
253+
filesState=$(find fixtures/state_tests -type f -name "*.json")
254+
filesEOF=$(find fixtures/eof_tests -type f -name "*.json")
255+
256+
BASE_TEST_PATH=${{ github.workspace }}/evmtest_coverage/coverage/BASE_TESTS
257+
mkdir -p $BASE_TEST_PATH
258+
259+
find fixtures/blockchain_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
260+
find fixtures/state_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
261+
find fixtures/eof_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
262+
for file in $BASE_TEST_PATH/*.json; do
263+
if [ -e "$file" ]; then
264+
mv "$file" "${file%.json}_$PREV_COMMIT.json"
265+
fi
266+
done
269267
270268
- name: Print tests that will be covered
271269
if: ${{ steps.changed-tests.outputs.tests_any_changed == 'true' }}
@@ -312,7 +310,7 @@ jobs:
312310
with:
313311
name: coverage-diff-native-${{ github.run_id }}-${{ github.run_attempt }}
314312
path: ${{ github.workspace }}/evmtest_coverage/coverage
315-
compression-level: 6 # Default compression level for optimal balance
313+
compression-level: 6 # Default compression level for optimal balance
316314

317315
- name: Verify coverage results
318316
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185

.github/workflows/docs_deploy.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ jobs:
2626
with:
2727
id: evm-builder
2828
type: stable
29-
- name: Set up uv
30-
uses: ./.github/actions/setup-uv
31-
- name: Set up Python
32-
run: uv python install 3.11
29+
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
30+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
31+
with:
32+
enable-cache: true
33+
cache-dependency-glob: "uv.lock"
34+
version: ${{ vars.UV_VERSION }}
35+
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
3336
- name: Install EEST and dependencies
3437
run: uv sync --extra=docs --no-progress
3538
- name: Setup doc deploy
@@ -39,7 +42,7 @@ jobs:
3942
- name: Build and deploy docs to gh-pages
4043
if: ${{ github.ref_type == 'branch' }}
4144
run: |
42-
uv run mike deploy --update-aliases --push --remote origin main development
45+
uv run mike deploy --update-aliases --push --remote origin main development
4346
- name: Build and deploy docs to gh-pages
4447
if: ${{ github.ref_type == 'tag' }}
4548
run: |

.github/workflows/tox_verify.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ name: Tox
33
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
6-
76
lint:
87
name: Lint python sources with ruff
98
runs-on: ubuntu-latest
109
steps:
1110
- name: Checkout ethereum/execution-spec-tests
1211
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
1312
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
14-
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231
13+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
1514
with:
1615
enable-cache: true
1716
cache-dependency-glob: "uv.lock"
@@ -27,7 +26,7 @@ jobs:
2726
- name: Checkout ethereum/execution-spec-tests
2827
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2928
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
30-
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231
29+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
3130
with:
3231
enable-cache: true
3332
cache-dependency-glob: "uv.lock"
@@ -43,7 +42,7 @@ jobs:
4342
- name: Checkout ethereum/execution-spec-tests
4443
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
4544
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
46-
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231
45+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
4746
with:
4847
enable-cache: true
4948
cache-dependency-glob: "uv.lock"
@@ -74,7 +73,7 @@ jobs:
7473
- name: Checkout ethereum/execution-spec-tests
7574
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
7675
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ vars.DEFAULT_PYTHON_VERSION }}
77-
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231
76+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
7877
with:
7978
enable-cache: true
8079
cache-dependency-glob: "uv.lock"
@@ -108,7 +107,7 @@ jobs:
108107
src/ethereum
109108
fetch-depth: 1
110109
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ matrix.python }}
111-
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231
110+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
112111
with:
113112
enable-cache: true
114113
cache-dependency-glob: "uv.lock"
@@ -120,7 +119,7 @@ jobs:
120119
run: uvx --with=tox-uv tox -e pytest
121120

122121
tests_deployed:
123-
name: Fill tests, deployed, ${{ matrix.os }}, ${{ matrix.python }}
122+
name: Fill tests, deployed, ${{ matrix.os }}, ${{ matrix.python }}
124123
runs-on: ${{ matrix.os }}
125124
strategy:
126125
matrix:
@@ -145,7 +144,7 @@ jobs:
145144
src/ethereum
146145
fetch-depth: 1
147146
- name: Install uv ${{ vars.UV_VERSION }} and python ${{ matrix.python }}
148-
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231
147+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
149148
with:
150149
enable-cache: true
151150
cache-dependency-glob: "uv.lock"

0 commit comments

Comments
 (0)