-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.39 KB
/
pytest.yml
File metadata and controls
64 lines (51 loc) · 1.39 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
name: "Unit Tests"
on:
pull_request:
jobs:
pytest:
runs-on: ubuntu-latest
defaults:
run:
working-directory: api
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --group dev
- name: Copy to .env
run: cp .env.dev.example .env
- name: Run tests
run: uv run pytest
- name: Upload coverage report
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: api/coverage.xml
sonar:
name: SonarCloud Scan
runs-on: ubuntu-latest
needs: pytest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
path: api/
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@2f77a1ec69fb1d595b06f35ab27e97605bdef703 # v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}