-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (87 loc) · 2.78 KB
/
python-check.yml
File metadata and controls
104 lines (87 loc) · 2.78 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
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
name: Python checks 🐍
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- backend/backlog_app/**
jobs:
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version-file: "backend/.python-version"
- name: Setup UV
uses: astral-sh/setup-uv@v7
- name: Install the project
working-directory: backend
run: uv sync --locked --all-extras --dev
- name: Run black
working-directory: backend
run: uv run black . --check --diff
- name: Run isort
working-directory: backend
run: uv run isort . --check-only --diff
run-tests:
runs-on: ubuntu-latest
container: node:24-bookworm-slim
needs:
- run-checks
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version-file: "backend/.python-version"
- name: Setup UV
uses: astral-sh/setup-uv@v7
- name: Install dependencies
working-directory: backend
run: uv sync --locked --all-extras --dev
- name: Run python tests
working-directory: backend
run: uv run pytest --cov=backlog_app --cov-report=xml:coverage.xml
env:
BACKLOG__DB__CONNECTION__USERNAME: test
BACKLOG__DB__CONNECTION__PASSWORD: test
BACKLOG__DB__CONNECTION__NAME: backlog
BACKLOG__DB__CONNECTION__HOST: localhost
BACKLOG__DB__CONNECTION__PORT: 5432
BACKLOG__SUPERUSER__EMAIL: admin@site.com
BACKLOG__SUPERUSER__PASSWORD: admin
BACKLOG__ACCESS_TOKEN_DB__RESET_PASSWORD_TOKEN_SECRET: secret1
BACKLOG__ACCESS_TOKEN_DB__VERIFICATION_TOKEN_SECRET: secret2
BACKLOG__SMTP__USERNAME: admin@site.com
BACKLOG__SMTP__PASSWORD: admin
BACKLOG__SMTP__SERVER: 127.0.0.1
BACKLOG__SMTP__PORT: 1025
BACKLOG__AI_AGENT__BASE_URL: https://example.com
BACKLOG__AI_AGENT__ACCESS_ID: 1234
BACKLOG__AI_AGENT__TOKEN: secret3
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: backend/coverage.xml
retention-days: 1
upload-report-to-codcov:
runs-on: ubuntu-latest
needs:
- run-tests
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: coverage-reports
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
codecov_yml_path: backend/coverage.yaml
fail_ci_if_error: 'true'