Skip to content

PyTest

PyTest #471

Workflow file for this run

name: PyTest
on:
pull_request:
branch: master
paths:
- '**.py'
- '**/pytest.yaml'
- 'pyproject.toml'
- 'poetry.lock'
schedule:
- cron: '0 2 * * *' # Every day at 2:00 AM UTC
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
pyversion: [ "3.10", "3.11", "3.12", "3.13" ]
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip
- os: windows-latest
path: ~\AppData\Local\pip\Cache
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Python (faster than using Python container)
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.pyversion }}
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v5
with:
path: ~/.local # the path depends on the OS
key: poetry-${{ runner.os }}-${{ matrix.pyversion }}-0 # increment to reset cache
- name: Install Poetry (Python3.8)
if: steps.cached-poetry.outputs.cache-hit != 'true' && matrix.pyversion == '3.8'
uses: snok/install-poetry@v1
with:
version: "1.8.5"
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true' && matrix.pyversion != '3.8'
uses: snok/install-poetry@v1
- name: Install Pytest and Evmspec
shell: bash
run: poetry run python -m pip install pytest .
- name: Run test suite
shell: bash
env:
PYTEST_NETWORK: mainnet
ETHERSCAN_TOKEN: ${{ secrets.ETHERSCAN_TOKEN }}
run: |
poetry run pytest