Skip to content

Commit 8f05b4e

Browse files
chore[ci]: refactor jobs to use gh actions (vyperlang#3863)
- roll memorymock tests into main test job - get rid of tox environment for memorymock - get rid of tox environments for fuzz and docs, move them to github actions this gets rid of tox entirely!
1 parent 176e7f7 commit 8f05b4e

File tree

7 files changed

+34
-73
lines changed

7 files changed

+34
-73
lines changed

.github/workflows/test.yml

+31-38
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ jobs:
5353
python-version: "3.11"
5454
cache: "pip"
5555

56-
- name: Install Tox
57-
run: pip install tox
56+
- name: Install deps
57+
# TODO these should really be in setup.py
58+
run: pip install shibuya sphinx sphinx-copybutton
5859

59-
- name: Run Tox
60-
run: TOXENV=docs tox -r
60+
- name: Run docs
61+
run: sphinx-build -E -b html docs dist/docs -n -q --color
6162

6263
# "Regular"/core tests.
6364
tests:
@@ -68,6 +69,7 @@ jobs:
6869
opt-mode: ["gas", "none", "codesize"]
6970
evm-version: [shanghai]
7071
debug: [true, false]
72+
memorymock: [false]
7173

7274
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
7375
include:
@@ -80,16 +82,27 @@ jobs:
8082
debug: false
8183
opt-mode: gas
8284
evm-version: paris
85+
86+
# redundant rule, for clarity
8387
- python-version: ["3.11", "311"]
8488
debug: false
8589
opt-mode: gas
8690
evm-version: shanghai
91+
8792
# enable when py-evm makes it work:
8893
#- python-version: ["3.11", "311"]
8994
# debug: false
9095
# opt-mode: gas
9196
# evm-version: cancun
9297

98+
# run with `--memorymock`, but only need to do it one configuration
99+
# TODO: consider removing the memorymock tests
100+
- python-version: ["3.11", "311"]
101+
opt-mode: gas
102+
debug: false
103+
evm-version: shanghai
104+
memorymock: true
105+
93106
# run across other python versions. we don't really need to run all
94107
# modes across all python versions - one is enough
95108
- python-version: ["3.10", "310"]
@@ -101,7 +114,7 @@ jobs:
101114
debug: false
102115
evm-version: shanghai
103116

104-
name: py${{ matrix.python-version[1] }}-opt-${{ matrix.opt-mode }}${{ matrix.debug && '-debug' || '' }}-${{ matrix.evm-version }}
117+
name: py${{ matrix.python-version[1] }}-opt-${{ matrix.opt-mode }}${{ matrix.debug && '-debug' || '' }}${{ matrix.memorymock && '-memorymock' || '' }}-${{ matrix.evm-version }}
105118

106119
steps:
107120
- uses: actions/checkout@v4
@@ -128,6 +141,7 @@ jobs:
128141
--optimize ${{ matrix.opt-mode }} \
129142
--evm-version ${{ matrix.evm-version }} \
130143
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} \
144+
${{ matrix.memorymock && '--memorymock' || '' }} \
131145
--showlocals -r aR \
132146
tests/
133147
@@ -168,17 +182,23 @@ jobs:
168182
python-version: "3.11"
169183
cache: "pip"
170184

171-
- name: Install Tox
172-
run: pip install tox
185+
- name: Install dependencies
186+
run: pip install .[test]
173187

174188
# fetch test durations
175189
# NOTE: if the tests get poorly distributed, run this and commit the resulting `.test_durations` file to the `vyper-test-durations` repo.
176-
# `TOXENV=fuzzing tox -r -- --store-durations -r aR tests/`
190+
# `pytest -m "fuzzing" --store-durations -r aR tests/`
177191
- name: Fetch test-durations
178-
run: curl --location "https://raw.githubusercontent.com/vyperlang/vyper-test-durations/5982755ee8459f771f2e8622427c36494646e1dd/test_durations" -o .test_durations
192+
run: curl --location "https://raw.githubusercontent.com/vyperlang/vyper-test-durations/master/test_durations" -o .test_durations
179193

180-
- name: Run Tox
181-
run: TOXENV=fuzzing tox -r -- --splits 60 --group ${{ matrix.group }} --splitting-algorithm least_duration -r aR tests/
194+
- name: Run tests
195+
run: |
196+
pytest \
197+
-m "fuzzing" \
198+
--splits 60 \
199+
--group ${{ matrix.group }} \
200+
--splitting-algorithm least_duration \
201+
-r aR tests/
182202
183203
- name: Upload Coverage
184204
uses: codecov/codecov-action@v4
@@ -197,30 +217,3 @@ jobs:
197217
- name: Check slow tests all succeeded
198218
if: ${{ needs.fuzzing.result != 'success' }}
199219
run: exit 1
200-
201-
memory:
202-
runs-on: ubuntu-latest
203-
204-
steps:
205-
- uses: actions/checkout@v4
206-
with:
207-
# need to fetch unshallow so that setuptools_scm can infer the version
208-
fetch-depth: 0
209-
210-
- name: Set up Python 3.11
211-
uses: actions/setup-python@v5
212-
with:
213-
python-version: "3.11"
214-
cache: "pip"
215-
216-
- name: Install Tox
217-
run: pip install tox
218-
219-
- name: Run Tox
220-
run: TOXENV=memory tox -r
221-
222-
- name: Upload Coverage
223-
uses: codecov/codecov-action@v4
224-
with:
225-
token: ${{ secrets.CODECOV_TOKEN }}
226-
file: ./coverage.xml

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
- id: mypy
2323
additional_dependencies:
2424
- "types-setuptools"
25-
args: # settings from tox.ini
25+
args: # settings from Makefile
2626
- --install-types
2727
- --non-interactive
2828
- --follow-imports=silent

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ exclude = '''
1313
| \.git
1414
| \.hg
1515
| \.mypy_cache
16-
| \.tox
1716
| \.venv
1817
| _build
1918
| buck-out

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ extend-ignore = E203
99
max-line-length = 100
1010
exclude =
1111
venv*
12-
.tox
1312
docs
1413
build
1514
per-file-ignores =

setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
extras_require = {
1010
"test": [
1111
"pytest>=8.0,<9.0",
12-
"pytest-cov>=2.10,<3.0",
12+
"pytest-cov>=4.1,<5.0",
1313
"pytest-instafail>=0.4,<1.0",
1414
"pytest-xdist>=2.5,<3.0",
1515
"pytest-split>=0.7.0,<1.0",
1616
"eth-tester[py-evm]>=0.9.0b1,<0.10",
1717
"eth_abi>=4.0.0,<5.0.0",
1818
"py-evm>=0.7.0a1,<0.8",
1919
"web3==6.0.0",
20-
"tox>=3.15,<4.0",
2120
"lark==1.1.9",
2221
"hypothesis[lark]>=6.0,<7.0",
2322
"eth-stdlib==0.2.7",

tests/functional/codegen/test_selector_table_stability.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_dense_jumptable_stability():
1313
)
1414

1515
# test that the selector table data is stable across different runs
16-
# (tox should provide different PYTHONHASHSEEDs).
16+
# (xdist should provide different PYTHONHASHSEEDs).
1717
expected_asm = """{ DATA _sym_BUCKET_HEADERS b\'\\x0bB\' _sym_bucket_0 b\'\\n\' b\'+\\x8d\' _sym_bucket_1 b\'\\x0c\' b\'\\x00\\x85\' _sym_bucket_2 b\'\\x08\' } { DATA _sym_bucket_1 b\'\\xd8\\xee\\xa1\\xe8\' _sym_external 6 foo6()3639517672 b\'\\x05\' b\'\\xd2\\x9e\\xe0\\xf9\' _sym_external 0 foo0()3533627641 b\'\\x05\' b\'\\x05\\xf1\\xe0_\' _sym_external 2 foo2()99737695 b\'\\x05\' b\'\\x91\\t\\xb4{\' _sym_external 23 foo23()2433332347 b\'\\x05\' b\'np3\\x7f\' _sym_external 11 foo11()1852846975 b\'\\x05\' b\'&\\xf5\\x96\\xf9\' _sym_external 13 foo13()653629177 b\'\\x05\' b\'\\x04ga\\xeb\' _sym_external 14 foo14()73884139 b\'\\x05\' b\'\\x89\\x06\\xad\\xc6\' _sym_external 17 foo17()2298916294 b\'\\x05\' b\'\\xe4%\\xac\\xd1\' _sym_external 4 foo4()3827674321 b\'\\x05\' b\'yj\\x01\\xac\' _sym_external 7 foo7()2036990380 b\'\\x05\' b\'\\xf1\\xe6K\\xe5\' _sym_external 29 foo29()4058401765 b\'\\x05\' b\'\\xd2\\x89X\\xb8\' _sym_external 3 foo3()3532216504 b\'\\x05\' } { DATA _sym_bucket_2 b\'\\x06p\\xffj\' _sym_external 25 foo25()108068714 b\'\\x05\' b\'\\x964\\x99I\' _sym_external 24 foo24()2520029513 b\'\\x05\' b\'s\\x81\\xe7\\xc1\' _sym_external 10 foo10()1937893313 b\'\\x05\' b\'\\x85\\xad\\xc11\' _sym_external 28 foo28()2242756913 b\'\\x05\' b\'\\xfa"\\xb1\\xed\' _sym_external 5 foo5()4196577773 b\'\\x05\' b\'A\\xe7[\\x05\' _sym_external 22 foo22()1105681157 b\'\\x05\' b\'\\xd3\\x89U\\xe8\' _sym_external 1 foo1()3548993000 b\'\\x05\' b\'hL\\xf8\\xf3\' _sym_external 20 foo20()1749874931 b\'\\x05\' } { DATA _sym_bucket_0 b\'\\xee\\xd9\\x1d\\xe3\' _sym_external 9 foo9()4007206371 b\'\\x05\' b\'a\\xbc\\x1ch\' _sym_external 16 foo16()1639717992 b\'\\x05\' b\'\\xd3*\\xa7\\x0c\' _sym_external 21 foo21()3542787852 b\'\\x05\' b\'\\x18iG\\xd9\' _sym_external 19 foo19()409552857 b\'\\x05\' b\'\\n\\xf1\\xf9\\x7f\' _sym_external 18 foo18()183630207 b\'\\x05\' b\')\\xda\\xd7`\' _sym_external 27 foo27()702207840 b\'\\x05\' b\'2\\xf6\\xaa\\xda\' _sym_external 12 foo12()855026394 b\'\\x05\' b\'\\xbe\\xb5\\x05\\xf5\' _sym_external 15 foo15()3199534581 b\'\\x05\' b\'\\xfc\\xa7_\\xe6\' _sym_external 8 foo8()4238827494 b\'\\x05\' b\'\\x1b\\x12C8\' _sym_external 26 foo26()454181688 b\'\\x05\' } }""" # noqa: E501
1818
assert expected_asm in output["asm"]
1919

tox.ini

-29
This file was deleted.

0 commit comments

Comments
 (0)