-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.47 KB
/
python_check.yml
File metadata and controls
59 lines (47 loc) · 1.47 KB
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
name: Python Package Check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install uv
run: pip install uv
- name: Cache uv dependencies
uses: actions/cache@v3
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
- name: Set up virtual environment and install deps
run: |
uv venv .venv
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
uv pip install -e . flake8 mypy pydocstyle coverage
- name: Run tests with coverage
run: |
coverage run -m unittest discover -s tests
coverage report -m
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
- name: Run Flake8
run: flake8 --max-line-length=88 --ignore=E203,F722,W503 src
- name: Run MyPy
if: always()
run: mypy --ignore-missing-imports --scripts-are-modules --follow-imports=skip src
- name: Run Pydocstyle
if: always()
run: pydocstyle --ignore-decorators=property src