-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (34 loc) · 1.13 KB
/
test-and-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Test and lint
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "**/poetry.lock"
- name: Install poetry
run: pip --disable-pip-version-check install -U poetry
- name: Install Python packages
run: poetry install
- name: Lint with flake8
if: matrix.python-version >= 3.8
run: |
poetry run flake8 --version
poetry run flake8 --show-source --statistics asserts test_asserts.py
- name: Type checking with mypy
run: |
poetry run mypy --version
poetry run mypy asserts test_asserts.py
- name: Test with unittest
run: poetry run python -Wall -m unittest test_asserts
- name: Run doctests
run: poetry run python -m doctest asserts/__init__.py