2022-04-18 23:59:30 +08:00
|
|
|
name: tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request_target:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
2022-04-19 00:50:38 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-04-18 23:59:30 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-04-19 00:50:38 +08:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2022-04-18 23:59:30 +08:00
|
|
|
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
|
|
|
|
|
|
|
env:
|
|
|
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install -U pip numpy cython mypy
|
|
|
|
pip install -U pytest codecov pytest-cov
|
|
|
|
pip install .
|
|
|
|
|
2022-04-19 00:32:33 +08:00
|
|
|
- name: Type checking
|
|
|
|
run: |
|
|
|
|
mypy pyModeS
|
2022-04-18 23:59:30 +08:00
|
|
|
|
|
|
|
- name: Run tests (without Cython)
|
|
|
|
run: |
|
|
|
|
pytest tests --cov --cov-report term-missing
|
|
|
|
|
|
|
|
- name: Install with Cython
|
|
|
|
run: |
|
|
|
|
pip install -U cython
|
2022-04-19 00:47:12 +08:00
|
|
|
pip uninstall -y pymodes
|
|
|
|
pip install .
|
2022-04-18 23:59:30 +08:00
|
|
|
|
|
|
|
- name: Run tests (with Cython)
|
|
|
|
run: |
|
|
|
|
pytest tests
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
if: ${{ github.event_name != 'pull_request_target' && env.PYTHON_VERSION == '3.10' }}
|
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
with:
|
|
|
|
env_vars: PYTHON_VERSION
|