Skip to content

Lint & Test

Lint & Test #21

Workflow file for this run

name: Lint & Test
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
lint-test:
strategy:
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11.0-rc.1" ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install --editable .[dev,tests]
# Run pylint and have it format the linting errors in the format of
# the GitHub Workflow command to register error annotations. This
# means that our pylint output is automatically added as an error
# annotation to both the run result and in the "Files" tab of a
# pull request.
#
# Format used:
# ::error file={filename},line={line},col={col}::{message}
- name: Run pylint
run: "python -m pylint src/ \
--msg-template='::error file={path},line={line},col={column}::[pylint] {category} {msg_id}: {msg}'"
- name: Run tests and generate coverage report
run: python -m pytest --cov --disable-warnings -q --cov-report=xml
- name: Upload Coverage to Codecov
uses: codecov/[email protected]
with:
fail_ci_if_error: true
flags: tests-${{ matrix.os }}-${{ matrix.python-version }}
verbose: true