-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
51 lines (49 loc) · 2.13 KB
/
action.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
name: 'Compile GAP package documentation'
description: 'Compile documentation with or without latex'
inputs:
use-latex:
description: 'if true, then install and use latex'
required: false
default: 'false'
runs:
using: "composite"
steps:
- name: "Install TeX Live"
shell: bash
run: |
if [ ${{ inputs.use-latex }} == 'true' ]; then
sudo apt-get update
sudo apt-get install --no-install-recommends texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
fi
- name: "Compile documentation"
shell: bash
run: |
# set up a custom GAP root containing only this package, so that
# we can force GAP to load the correct version of this package
# (we already did that in build_pkg.sh, but we do it again here,
# to allow the occasional instance where a package wants to also
# run the tests of others packages, by invoking this script multiple
# times in different directories)
mkdir -p /tmp/gaproot/pkg/
ln -f -s $PWD /tmp/gaproot/pkg/
if [ -f "makedoc.g" ]; then
$HOME/gap/gap -l "/tmp/gaproot;" --quitonbreak makedoc.g -c "QUIT;"
elif [ -x "doc/make_doc" ]; then
# If the package is called <pkg_name>, then the <doc/make_doc> script
# most likely assumes that it has been called from the within the
# <pkg_name>/doc folder, and that the directory hierarchy is
# <gaproot>/pkg/<pkg_name>/doc/make_doc, and relies on this to access
# several file.
# So we create symlinks to some potentially-useful GAP directories.
[ -d ../../doc ] && echo "../../doc exists" || ln -s $HOME/gap/doc ../../doc
[ -d ../../etc ] && echo "../../etc exists" || ln -s $HOME/gap/etc ../../etc
cd doc && ./make_doc
elif [ -f "doc/make_doc" ]; then
echo "doc/make_doc exists but is not executable!"
exit 1
else
echo "no makedoc.g file or doc/make_doc script found!"
exit 1
fi
env:
SOURCE_DATE_EPOCH: 0 # prevent time stamps in generated PDF