-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 1.92 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
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
UV_CACHE_DIR: /tmp/.uv-cache
jobs:
ci:
name: Run Tests, Linting, and Build Documentation
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.12, 3.13]
fail-fast: true
timeout-minutes: 20
steps:
- name: Checkout Repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up UV Environment
uses: astral-sh/[email protected]
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Restore UV Cache
uses: actions/[email protected]
with:
path: ${{ env.UV_CACHE_DIR }}
key: "uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}"
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install Dependencies and Sync Project
run: uv sync
- name: Run Formatting, Linting, Type Checks, and Tests
run: |
uv run ruff format ./
uv run ruff check --fix ./
uv run mypy ./
uv run pytest ./
- name: Upload Test Coverage to Codecov
uses: codecov/[email protected]
with:
token: '${{ secrets.CODECOV_TOKEN }}'
file: ./coverage.xml
fail_ci_if_error: true
- name: Scan with SonarCloud
uses: SonarSource/[email protected]
env:
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}'
- name: Build Documentation
run: uv run --group=docs make clean html --directory docs/
- name: Upload Documentation to GitHub Pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
- name: Minimize UV Cache
run: uv cache prune --ci