-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (49 loc) · 1.23 KB
/
test_and_doc.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
name: Docs and tests
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
pytest --html=build/tests/index.html --self-contained-html -vv
- name: Generate documentation
run: |
cd docs/
make html
cd ..
- name: Move doc to build folder
run: |
mkdir -p build/docs
mv docs/_build/html/* build/docs/
- name: Upload GitHub Pages artifact
if: always()
uses: actions/[email protected]
with:
path: build/
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy GitHub Pages site
if: always()
id: deployment
uses: actions/[email protected]