Lint and test #117
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: Lint and test | |
on: | |
schedule: | |
- cron: "0 0 1 * *" | |
push: | |
paths-ignore: | |
- ".gitignore" | |
- "README.md" | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
max-parallel: 6 | |
matrix: | |
os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] | |
python-version: [ "3.9", "3.10", "3.11", "3.12" ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache-dependency-path: pyproject.toml | |
cache: poetry | |
- name: Install dependencies | |
if: steps.setup-python.outputs.cache-hit != 'true' | |
run: poetry install | |
- name: Lint code with black | |
run: poetry run black --check . | |
- name: Lint code with ruff | |
run: poetry run ruff check . | |
- name: Test code with pytest | |
run: poetry run pytest --doctest-modules |