Install dependency #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run test suite | |
on: [push, pull_request] | |
concurrency: | |
# cancel older, in-progress jobs from the same PR, same workflow. | |
# use run_id if the job is triggered by a push to ensure | |
# push-triggered jobs to not get canceled. | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
# "Regular"/core tests. | |
tests: | |
runs-on: ${{ matrix.os || 'ubuntu' }}-latest | |
# IMPORTANT: Test defaults are duplicated in the "Run tests" step below! | |
# it is annoying that we need to duplicate them, but it is necessary | |
# to avoid repeating defaults for every "include" in the matrix. | |
name: "${{ matrix.os && matrix.os != 'ubuntu' && format('{0}-', matrix.os) || '' }}\ | |
py${{ matrix.python-version[1] || '311' }}\ | |
-opt-${{ matrix.opt-mode || 'gas' }}\ | |
${{ matrix.debug && '-debug' || '' }}\ | |
${{ matrix.experimental-codegen && '-experimental' || '' }}\ | |
-${{ matrix.evm-version || 'cancun' }}\ | |
-${{ matrix.evm-backend || 'revm' }}" | |
strategy: | |
matrix: | |
# declare all variables used in the "include" section here! Conflicting jobs get overwritten by GitHub actions. | |
python-version: [["3.11", "311"], ["3.12", "312"]] # note: do not forget to replace 311 in the job names when upgrading! | |
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] || '3.11' }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version[0] || '3.11' }} | |
cache: "pip" | |
- name: Install dependencies | |
run: pip install .[test] | |
- name: Setup Graphviz for profiling tests | |
uses: ts-graphviz/setup-graphviz@v2 | |
- name: Debug dependencies | |
run: pip freeze | |
- name: Run tests | |
run: > | |
pytest | |
--profile-svg | |
-m "not fuzzing" | |
--optimize ${{ matrix.opt-mode || 'gas' }} | |
--evm-version ${{ matrix.evm-version || 'cancun' }} | |
--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 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
- name: Upload profiling data | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: profiling-${{ matrix.python-version[1] }}-${{ matrix.opt-mode }}${{ matrix.debug && '-debug' || '' }} | |
path: prof/combined.svg | |
core-tests-success: | |
if: always() | |
# summary result from test matrix. | |
# see https://github.community/t/status-check-for-a-matrix-jobs/127354/7 | |
runs-on: ubuntu-latest | |
needs: [tests] | |
steps: | |
- name: Check tests tests all succeeded | |
if: ${{ needs.tests.result != 'success' }} | |
run: exit 1 |