-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (89 loc) · 2.38 KB
/
Copy pathci.yml
File metadata and controls
108 lines (89 loc) · 2.38 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
105
106
107
108
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
# allow trigger manually from actions
workflow_dispatch:
# Cancel jobs running if new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
style:
name: "style"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Install uv"
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: "Install project"
run: |
uv sync
- name: "pre-commit check"
run: |
uv run prek --all-files
test-backend:
name: "test backend with pytest"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "check for changes to python files"
uses: dorny/paths-filter@v4
id: changes
with:
filters: |
python:
- "**/*.py"
- name: "Install uv"
if: steps.changes.outputs.python == 'true'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: "Install project"
if: steps.changes.outputs.python == 'true'
run: |
uv sync
- name: "pytest"
if: steps.changes.outputs.python == 'true'
run: |
uv run pytest -v tests/
deploy-docs:
name: "deploy docs"
# needed for gh-pages
permissions:
contents: write
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: "Install uv"
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: "Install project with docs extras"
run: |
uv sync --group docs
- name: "Build Sphinx docs"
run: |
uv run sphinx-build -b html docs docs/_build
- name: "Upload Pages artifact"
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build
- name: "Deploy to GitHub Pages"
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/