-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.07 KB
/
CI.yaml
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
name: CI
# Trigger the workflow on push and pull request events to the main branch
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
# Job 1: Run Tests
test:
name: Run Tests on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
# Define a matrix of Python versions to test against
strategy:
matrix:
python-version: [3.11, 3.12, 3.13]
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Set up the specified Python version
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Step 3: Install dependencies using Hatch
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
hatch env create
hatch run install
# Step 4: Run the test suite
- name: Run Tests
run: hatch run test
# Job 2: Build and Deploy Documentation
build_and_deploy_docs:
name: Build and Deploy Documentation
runs-on: ubuntu-latest
needs: test # Ensure tests pass before building docs
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Set up Python (using a specific version for consistency)
- name: Set Up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
# Step 3: Install dependencies for building docs
- name: Install Documentation Dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
hatch env create docs
hatch run docs-build
# Step 4: Deploy the generated docs to the gh-pages branch
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/site
publish_branch: gh-pages