-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (68 loc) · 2.32 KB
/
ci.yml
File metadata and controls
86 lines (68 loc) · 2.32 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
name: CI & Deploy
on:
push:
branches: ["master", "main"]
pull_request:
branches: ["master", "main"]
jobs:
test:
name: Setup and Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v1
- name: Install project and dependencies
run: |
uv sync --all-extras --dev
uv pip install -e . --no-deps
- name: Run tests
run: uv run pytest tests
deploy-docs:
name: Deploy MkDocs Site to GitHub Pages
runs-on: ubuntu-latest
needs: test # Only run this job if the 'test' job succeeds
# Only run this job on pushes to the 'master' or 'main' branch, NOT on pull requests
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v1
- name: Install dependencies for docs
run: |
uv sync --all-extras
uv pip install -e . --no-deps
- name: Generate Graph Example HTML Files
run: python generate_graph_examples.py
- name: Build MkDocs site
run: uv run mkdocs build --verbose
- name: Upload artifact for GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: './site' # Path to the directory containing the built MkDocs site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# This action will automatically use the artifact uploaded in the previous step