-
-
Notifications
You must be signed in to change notification settings - Fork 20
66 lines (56 loc) · 2.11 KB
/
documentation.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
name: Documentation check
on: [pull_request]
jobs:
docs-checks:
name: ${{ matrix.doc-type }}
strategy:
matrix:
doc-type: [html, latex, epub]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Linux Environment
run: |
sudo apt-get install libglu1
- name: Install docs dependencies
run: |
python -m pip install -r docs/requirements.txt
- name: Install package
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
- name: Build ${{ matrix.doc-type }} documentation
run: sphinx-build -Wnb ${{ matrix.doc-type }} docs/source/ docs/build-${{ matrix.doc-type }}/
- name: Prepare documentation artifact
run: |
# Define Path to Upload
if [ "${{ matrix.doc-type }}" = html ]; then echo "art_path=docs/build-html" >> $GITHUB_ENV; fi
if [ "${{ matrix.doc-type }}" = latex ]; then echo "art_path=docs/build-latex/MicroStructPy.pdf" >> $GITHUB_ENV; fi
if [ "${{ matrix.doc-type }}" = epub ]; then echo "art_path=docs/build-epub/MicroStructPy.epub" >> $GITHUB_ENV; fi
- name: Build PDF (latex only)
if: matrix.doc-type == 'latex'
run: |
# Update apt
sudo apt-get update
# Install LaTeX packages
# Recommended by Sphinx on their docs page:
# https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.latex.LaTeXBuilder
sudo apt install texlive-latex-recommended
sudo apt install texlive-fonts-recommended
sudo apt install tex-gyre # (if latex_engine left to default)
sudo apt install texlive-latex-extra
sudo apt install latexmk
# Make
cd docs/build-latex
make
cd -
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: microstructpy_${{ matrix.doc-type }}_documentation
path: ${{ env.art_path }}