-
-
Notifications
You must be signed in to change notification settings - Fork 56
74 lines (63 loc) · 1.96 KB
/
pythonpackage.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Lint, Type checking and Test Python Package
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
package-lint-and-test:
name: ${{ matrix.os }} / ${{ matrix.python-version }} ${{ matrix.suffix }}
runs-on: ${{ matrix.image }}
strategy:
matrix:
os: [Ubuntu]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
poetry-version: ["1.7.1"]
include:
- os: Ubuntu
image: ubuntu-latest
fail-fast: false
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install poetry dependencies
run: |
poetry install
- name: Code style
run: |
poetry run python -m black --check .
poetry run python -m isort -c .
- name: Lint
run: |
poetry run python -m flake8 .
# poetry run python -m pylint .
- name: Typing
run: poetry run python -m mypy .
- name: Test
run: poetry run python -m pytest --cov=. --cov-report term --cov-report xml --cov-config .coveragerc --junitxml=testresults.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: unittests
env_vars: OS,PYTHON
name: Python ${{ matrix.python-version }} on ${{ runner.os }}
# - name: Build HTML docs
# run: |
# poetry run python -m pip install --editable .[docs]
# cd docs
# make html
# cd ..