-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (62 loc) · 2.01 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
name: CI
on:
push:
branches:
- main
jobs:
# take out unit tests
test:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8" # oldest version; end of live in October 2024
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install TexLive
run: |
sudo apt-get update
sudo apt-get install --fix-missing pdf2svg texlive-latex-base texlive-binaries texlive-pictures texlive-latex-extra texlive-luatex
- name: Install package dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .[tests]
- name: Test with unittest
run: python -m unittest
# build and push documentation to gh-pages
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Build documentation
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .[docs]
sphinx-apidoc --force --output-dir docs/source critdd
sphinx-build -M html docs/source docs/build
- name: Publish documentation
run: |
git clone ${{ github.server_url }}/${{ github.repository }}.git --branch gh-pages --single-branch __gh-pages/
cp -r docs/build/html/* __gh-pages/
cd __gh-pages/
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -am "Documentation based on ${{ github.sha }}" || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: __gh-pages/
github_token: ${{ secrets.GITHUB_TOKEN }}