-
-
Notifications
You must be signed in to change notification settings - Fork 23
84 lines (72 loc) · 1.83 KB
/
check.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
75
76
77
78
79
80
81
82
83
84
name: Checks
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
ANSICON: 1
FORCE_COLOR: 1
jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
steps:
- name: "🗃 Cache"
if: success() || failure()
uses: actions/cache@v3
with:
path: |
~/.cache
.mypy_cache
.pytest_cache
.ruff_cache
key: ${{ runner.os }}-${{ matrix.python-version }}-check
- name: "📥 Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "✨ Install Poetry"
run: |
pipx install poetry
pipx inject poetry poetry-dynamic-versioning
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: "📥 Install the package"
run: make install
- name: "🪄 Linter: Ruff"
if: success() || failure()
run: make lint/ruff
env:
RUFF_FORMAT: "github"
- name: "🪄 Linter: mypy"
if: success() || failure()
run: make lint/mypy
- name: "🧪 Tests"
if: success() || failure()
run: make test
- name: "📤 Codecov"
if: success() || failure()
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON
name: Python ${{ matrix.python-version }}
files: coverage.xml
fail_ci_if_error: false # FIXME: https://github.com/codecov/codecov-action/issues/720
- name: "📦 Build and publish package: dry run"
if: success() || failure()
run: poetry publish --build --dry-run --ansi