-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (88 loc) · 2.54 KB
/
CI.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This workflow will install Python dependencies, run tests and lint.
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
checks:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Install poetry
run: |
pipx install poetry
- name: Chekout Repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "poetry"
- name: Install dependencies
run: |
poetry env use 3.11
poetry config installer.modern-installation false
poetry install
- name: Verify formatting
run: |
poetry run ruff . --select I
poetry run ruff format --check .
- name: Lint
run: |
poetry run ruff . --exit-zero
poetry run mypy --install-types --non-interactive .
poetry run mypy --html-report=mypy_report .
- name: "Upload Mypy Report"
uses: actions/upload-artifact@v3
with:
name: mypy
path: mypy_report
- name: Build Docs
run: |
make docs
- name: Upload Docs
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/site
- name: Build Wheel
run: |
python -m pip install --upgrade pip
pip install build
python -m build .
- name: "Upload Distribution"
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: Run tests
run: |
poetry run coverage run -m pytest --html=test_report.html --self-contained-html
- name: "Upload Coverage"
uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage.*
- name: Show Coverage Report
run: |
poetry run coverage combine
poetry run coverage report
- name: Create HTML report
run: |
poetry run coverage html
- name: Upload HTML report
uses: actions/upload-artifact@v3
with:
name: coverage_html
path: htmlcov
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage
- name: Check minimum coverage
run: |
poetry run coverage report
poetry run echo '## Test Coverage Report' >> $GITHUB_STEP_SUMMARY
poetry run coverage report --format markdown >> $GITHUB_STEP_SUMMARY