-
Notifications
You must be signed in to change notification settings - Fork 38
90 lines (86 loc) · 2.76 KB
/
update-doc-pdf.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Check and render LaTeX doc into pdf
on:
push:
branches:
- master
paths:
- doc/**
- .github/workflows/update-doc-pdf.yml
pull_request:
branches:
- master
paths:
- doc/**
- .github/workflows/update-doc-pdf.yml
workflow_dispatch:
jobs:
check-parameters:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.11"
activate-environment: sparc-test
conda-build-version: "24.9.0"
miniforge-version: latest # Fix according to https://github.com/conda-incubator/setup-miniconda?tab=readme-ov-file#example-10-miniforge
channels: conda-forge,defaults
channel-priority: true
- name: Install SPARC-X-API stable version for docparser
run: |
mamba install -c conda-forge pip setuptools
pip install git+https://github.com/SPARC-X/[email protected]
- name: Convert parameters.json
run: |
python -m sparc.docparser --include-subdirs doc/.LaTeX
- name: Check missing parameters in test examples
run: |
# Usage:
# python test-missing-parameters.py <test-dir> <parameters.json>
# If test fails, a list of missing / typo params will
# be written in output
python .github/workflows/test-missing-parameters.py \
tests/ ./parameters.json
render-pdf-linux:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
needs: check-parameters
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.11"
activate-environment: sparc-test
conda-build-version: "24.9.0"
miniforge-version: latest # Fix according to https://github.com/conda-incubator/setup-miniconda?tab=readme-ov-file#example-10-miniforge
channels: conda-forge,defaults
channel-priority: true
- name: Install tectonic as latex rendering engine
run: |
mamba install -c conda-forge tectonic
- name: Make temp build dir
run: |
mkdir -p doc/_build
- name: Render main manual
run: |
tectonic -X compile doc/.LaTeX/Manual.tex \
--outdir doc/_build
ls -al doc/_build
- name: Render subdir manuals
run: |
for dir in doc/.LaTeX/*; do
if [ -d "$dir" ]; then
manual=$(find "$dir" -maxdepth 1 -name "*Manual.tex" | head -n 1)
if [ -n "$manual" ]; then
tectonic -X compile "$manual" \
--outdir doc/_build
echo "Rendered: $manual"
fi
fi
done
ls -al doc/_build