Skip to content

Update codecov action. #67

Update codecov action.

Update codecov action. #67

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Linting and Tests
on:
[push, pull_request]
jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.10"]
optionals: [none, pandas, numba]
exclude:
- python-version: "pypy3.10"
optionals: pandas
- python-version: "pypy3.10"
optionals: numba
- python-version: "3.11"
optionals: numba
- os: macos-latest
python-version: "pypy3.10"
- os: windows-latest
python-version: "pypy3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 tox
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with tox/pytest
run: |
tox -e py-${{ matrix.optionals }}
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
mypy:
name: Mypy checks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- python-version: 3.7
extra-args: "--no-warn-unused-ignores"
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools_scm[toml] wheel setuptools
python -m pip install numpy pandas flake8 tox mypy
- name: Mypy
run: |
mypy --cache-dir .mypy_cache --install-types ${{ matrix.extra-args }} --non-interactive --strict --allow-untyped-calls --ignore-missing-imports --non-interactive ./src
black:
name: Black checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options: "--check --verbose --diff"
src: "./src"