@@ -3,9 +3,9 @@ name: Evmone Coverage Report
33on :
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
1010jobs :
1111 evmone-coverage-diff :
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
0 commit comments