-
Notifications
You must be signed in to change notification settings - Fork 15
101 lines (84 loc) · 3.01 KB
/
nmodl-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
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
91
92
93
94
95
96
97
98
99
100
101
name: NMODL Documentation
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- release/**
pull_request:
branches:
- master
- release/**
env:
BUILD_TYPE: Release
PYTHON_VERSION: 3.8
DESIRED_CMAKE_VERSION: 3.15.0
jobs:
ci:
runs-on: ubuntu-20.04
name: documentation
env:
INSTALL_DIR: install
strategy:
fail-fast: true
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: ${{ env.DESIRED_CMAKE_VERSION }}
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install bison ccache dvipng doxygen flex libfl-dev \
ninja-build pandoc python3-dev python3-pip \
texlive-latex-recommended texlive-latex-extra
shell: bash
- name: Set up Python3
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/checkout@v3
- name: Install Python3 dependencies
working-directory: ${{runner.workspace}}/nmodl
run: |
pip3 install -U pip setuptools
pip3 install --user -r requirements.txt
# This step will set up an SSH connection on tmate.io for live debugging.
# To trigger it, simply add 'live-debug-docs' to your last pushed commit message.
- name: live debug session on failure
if: failure() && contains(github.event.head_commit.message, 'live-debug-docs')
uses: mxschmitt/action-tmate@v3
- name: Restore compiler cache
uses: actions/cache@v3
with:
path: |
${{runner.workspace}}/ccache
key: docs-${{github.ref}}-${{github.sha}}
restore-keys: |
docs-${{github.ref}}-
docs-
- name: Documentation
id: documentation
working-directory: ${{runner.workspace}}/nmodl
run: |
echo "------- Build Documentation -------";
ccache -z
ccache -s
python3 setup.py build_ext --inplace docs -j 2 -G Ninja \
-- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache;
ccache -s
cd _skbuild/linux-x86_64-3.8/setuptools/sphinx;
rm -rf doctest doctrees && touch .nojekyll;
echo "<meta http-equiv=\"refresh\" content=\"0; url=./html/index.html\" />" > index.html;
echo "status=done" >> $GITHUB_OUTPUT
env:
CCACHE_DIR: ${{runner.workspace}}/ccache
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: steps.documentation.outputs.status == 'done' && startsWith(github.ref, 'refs/heads/master')
with:
branch: gh-pages # The branch the action should deploy to.
folder: ${{runner.workspace}}/nmodl/_skbuild/linux-x86_64-3.8/setuptools/sphinx # The folder the action should deploy.
clean: false # Automatically remove deleted files from the deploy branch