-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 1.7 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
name: CI
on:
pull_request:
types: [opened, synchronize]
push:
branches: ['master', 'main']
env:
PYTHONPATH: './src:./test'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: setup tox
run: pip install tox
- name: test
run: |
TOXENV="py$(echo ${{ matrix.python-version }} | sed 's/\.//')"
tox -e "${TOXENV}"
build-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: pip install -e .[doc]
- name: Sphinx build
run: sphinx-build docs docs/_build --builder html --fresh-env
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/
deploy-doc:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: build-docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4