Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore[ci]: refactor jobs to use gh actions #3863

Merged
merged 18 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from 17 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
69 changes: 31 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ jobs:
python-version: "3.11"
cache: "pip"

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

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

# "Regular"/core tests.
tests:
Expand All @@ -68,6 +69,7 @@ jobs:
opt-mode: ["gas", "none", "codesize"]
evm-version: [shanghai]
debug: [true, false]
memorymock: [false]

# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
include:
Expand All @@ -80,16 +82,27 @@ jobs:
debug: false
opt-mode: gas
evm-version: paris

# redundant rule, for clarity
- python-version: ["3.11", "311"]
debug: false
opt-mode: gas
evm-version: shanghai

# enable when py-evm makes it work:
#- python-version: ["3.11", "311"]
# debug: false
# opt-mode: gas
# evm-version: cancun

# run with `--memorymock`, but only need to do it one configuration
# TODO: consider removing the memorymock tests
- python-version: ["3.11", "311"]
opt-mode: gas
debug: false
evm-version: shanghai
memorymock: true

# run across other python versions. we don't really need to run all
# modes across all python versions - one is enough
- python-version: ["3.10", "310"]
Expand All @@ -101,7 +114,7 @@ jobs:
debug: false
evm-version: shanghai

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

steps:
- uses: actions/checkout@v4
Expand All @@ -128,6 +141,7 @@ jobs:
--optimize ${{ matrix.opt-mode }} \
--evm-version ${{ matrix.evm-version }} \
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} \
${{ matrix.memorymock && '--memorymock' || '' }} \
--showlocals -r aR \
tests/

Expand Down Expand Up @@ -168,17 +182,23 @@ jobs:
python-version: "3.11"
cache: "pip"

- name: Install Tox
run: pip install tox
- name: Install dependencies
run: pip install .[test]

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

- name: Run Tox
run: TOXENV=fuzzing tox -r -- --splits 60 --group ${{ matrix.group }} --splitting-algorithm least_duration -r aR tests/
- name: Run tests
run: |
pytest \
-m "fuzzing" \
--splits 60 \
--group ${{ matrix.group }} \
--splitting-algorithm least_duration \
-r aR tests/

- name: Upload Coverage
uses: codecov/codecov-action@v4
Expand All @@ -197,30 +217,3 @@ jobs:
- name: Check slow tests all succeeded
if: ${{ needs.fuzzing.result != 'success' }}
run: exit 1

memory:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
# need to fetch unshallow so that setuptools_scm can infer the version
fetch-depth: 0

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install Tox
run: pip install tox

- name: Run Tox
run: TOXENV=memory tox -r

- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
extras_require = {
"test": [
"pytest>=8.0,<9.0",
"pytest-cov>=2.10,<3.0",
"pytest-cov>=4.1,<5.0",
"pytest-instafail>=0.4,<1.0",
"pytest-xdist>=2.5,<3.0",
"pytest-split>=0.7.0,<1.0",
"eth-tester[py-evm]>=0.9.0b1,<0.10",
"eth_abi>=4.0.0,<5.0.0",
"py-evm>=0.7.0a1,<0.8",
"web3==6.0.0",
"tox>=3.15,<4.0",
"lark==1.1.9",
"hypothesis[lark]>=6.0,<7.0",
"eth-stdlib==0.2.7",
Expand Down
29 changes: 0 additions & 29 deletions tox.ini

This file was deleted.

Loading