-
Notifications
You must be signed in to change notification settings - Fork 8
66 lines (55 loc) Β· 1.62 KB
/
Copy pathpython-test.yml
File metadata and controls
66 lines (55 loc) Β· 1.62 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
60
61
62
63
64
65
66
name: Test
on:
pull_request:
branches:
# - main
- python-template
push:
branches:
# - main
- python-template
jobs:
build-lint-format-and-test:
runs-on: ubuntu-latest
steps:
## Checkout Repository
- name: ποΈ Checkout
uses: actions/checkout@v4
## Install UV Package Manager
- name: π¦ Install uv
uses: astral-sh/setup-uv@v4
## Setup Python Environment
- name: π Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
## Install Dependencies
- name: π¦Ύ Install the project
run: |
uv sync --all-extras --dev
uv pip install -e .
## --- Install 'task' CLI ---
- name: Install Taskfile CLI
run: |
sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
echo "PATH=/usr/local/bin:$PATH" >> $GITHUB_ENV ## Add Task CLI to PATH
task --version
## Code Quality Checks
- name: π
Lint and Format Check
run: |
task check_code_quality
## Run Unit Tests
- name: π§ͺ Unit Tests
run: |
export PYTHONPATH=src:$PYTHONPATH
uv run pytest tests/
## Test Coverage Report
- name: π Test Coverage
run: |
uv run pytest --cov=src/runbooks --cov-report=xml tests/
## Upload Coverage Report
- name: π Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml