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[test]: add macos to test matrix #4025

Merged
merged 16 commits into from
May 15, 2024
Merged
95 changes: 39 additions & 56 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ jobs:

# "Regular"/core tests.
tests:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os || 'ubuntu' }}-latest
strategy:
matrix:
os: [ubuntu]
python-version: [["3.11", "311"]]
opt-mode: ["gas", "none", "codesize"]
opt-mode: [gas, none, codesize]
debug: [true, false]
evm-version: [shanghai]
experimental-codegen: [false]
Expand All @@ -75,97 +76,79 @@ jobs:
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
include:
# test default settings with 3.11 across all supported evm versions
- python-version: ["3.11", "311"]
debug: false
- debug: false
opt-mode: gas
evm-version: london
evm-backend: revm

- python-version: ["3.11", "311"]
debug: false
- debug: false
opt-mode: gas
evm-version: paris
evm-backend: revm

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

- python-version: ["3.11", "311"]
debug: false
- debug: false
opt-mode: gas
evm-version: cancun
evm-backend: revm

# py-evm rules
- python-version: ["3.11", "311"]
debug: false
- debug: false
opt-mode: codesize
evm-version: london
evm-backend: py-evm

- python-version: ["3.11", "311"]
debug: false
- debug: false
opt-mode: gas
evm-version: cancun
evm-backend: py-evm

# test experimental pipeline
- python-version: ["3.11", "311"]
opt-mode: gas
- opt-mode: gas
debug: false
evm-version: shanghai
evm-backend: revm
experimental-codegen: true

- python-version: ["3.11", "311"]
opt-mode: codesize
- opt-mode: codesize
debug: false
evm-version: shanghai
evm-backend: revm
experimental-codegen: true

- python-version: ["3.11", "311"]
opt-mode: none
- opt-mode: none
debug: false
evm-version: shanghai
evm-backend: revm
experimental-codegen: true

# os-specific rules
- os: windows
opt-mode: none
DanielSchiavini marked this conversation as resolved.
Show resolved Hide resolved
debug: false

- os: macos
opt-mode: none
debug: false

# 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"]
opt-mode: gas
debug: false
evm-version: shanghai
evm-backend: revm

- python-version: ["3.12", "312"]
opt-mode: gas
debug: false
evm-version: shanghai
evm-backend: revm

name: "py${{ matrix.python-version[1] }}\
-opt-${{ matrix.opt-mode }}\
name: "py${{ matrix.python-version[1] || '311' }}\
-opt-${{ matrix.opt-mode || 'none' }}\
${{ matrix.debug && '-debug' || '' }}\
${{ matrix.experimental-codegen && '-experimental' || '' }}\
-${{ matrix.evm-version }}\
-${{ matrix.evm-backend }}"
-${{ matrix.evm-version || 'shanghai' }}\
-${{ matrix.evm-backend || 'revm' }}\
-${{ matrix.os || 'ubuntu' }}"

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 ${{ matrix.python-version[0] }}
- name: Set up Python ${{ matrix.python-version[0] || '3.11' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version[0] }}
python-version: ${{ matrix.python-version[0] || '3.11' }}
cache: "pip"

- name: Install dependencies
Expand All @@ -175,18 +158,18 @@ jobs:
run: pip freeze

- name: Run tests
run: |
pytest \
-m "not fuzzing" \
--optimize ${{ matrix.opt-mode }} \
--evm-version ${{ matrix.evm-version }} \
${{ matrix.evm-backend && format('--evm-backend {0}', matrix.evm-backend) || '' }} \
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} \
${{ matrix.experimental-codegen && '--experimental-codegen' || '' }} \
--cov-branch \
--cov-report xml:coverage.xml \
--cov=vyper \
tests/
run: >
pytest
-m "not fuzzing"
--optimize ${{ matrix.opt-mode || 'none' }}
--evm-version ${{ matrix.evm-version || 'shanghai' }}
--evm-backend ${{ matrix.evm-backend || 'revm' }}
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }}
${{ matrix.experimental-codegen && '--experimental-codegen' || '' }}
--cov-branch
--cov-report xml:coverage.xml
--cov=vyper
tests/

- name: Upload Coverage
uses: codecov/codecov-action@v3
Expand Down
Loading