Skip to content

Commit acf526a

Browse files
authored
GHA: Clean up custom doxygen (#2201)
Handle installation and dependencies in one single place.
1 parent 17f85fb commit acf526a

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Set up doxygen
2+
description: |
3+
Download, build, and install doxygen.
4+
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Install apt dependencies for doxygen
9+
run: |
10+
sudo apt-get update \
11+
&& sudo apt-get install -y \
12+
bison \
13+
ragel \
14+
graphviz \
15+
texlive-latex-extra
16+
shell: bash
17+
18+
- name: Download and build doxygen
19+
run: sudo scripts/downloadAndBuildDoxygen.sh
20+
shell: bash

.github/workflows/test_doc.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ on:
1616
jobs:
1717
doxygen:
1818
name: Test Doxygen
19-
2019
runs-on: ubuntu-22.04
2120

2221
strategy:
@@ -32,26 +31,14 @@ jobs:
3231
- uses: actions/checkout@v3
3332
- run: git fetch --prune --unshallow
3433

35-
- name: apt
36-
run: |
37-
sudo apt-get update \
38-
&& sudo apt-get install -y \
39-
bison \
40-
ragel \
41-
graphviz \
42-
texlive-latex-extra
43-
44-
- name: Build doxygen
45-
run: |
46-
sudo scripts/downloadAndBuildDoxygen.sh
34+
- name: Set up doxygen
35+
uses: ./.github/actions/setup-doxygen
4736

4837
- name: Run doxygen
49-
run: |
50-
scripts/run-doxygen.sh
38+
run: scripts/run-doxygen.sh
5139

5240
sphinx:
5341
name: Test Sphinx
54-
5542
runs-on: ubuntu-22.04
5643

5744
strategy:
@@ -70,9 +57,8 @@ jobs:
7057
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
7158
- run: echo "SWIG=${AMICI_DIR}/ThirdParty/swig-4.1.1/install/bin/swig" >> $GITHUB_ENV
7259

73-
- name: Build doxygen
74-
run: |
75-
sudo scripts/downloadAndBuildDoxygen.sh
60+
- name: Set up doxygen
61+
uses: ./.github/actions/setup-doxygen
7662

7763
# install amici dependencies
7864
- name: apt
@@ -90,5 +76,4 @@ jobs:
9076
sudo scripts/downloadAndBuildSwig.sh
9177
9278
- name: sphinx
93-
run: |
94-
scripts/run-sphinx.sh
79+
run: scripts/run-sphinx.sh

scripts/downloadAndBuildDoxygen.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#!/usr/bin/env bash
22
# Download and build Doxygen (in case apt or homebrew version is buggy again)
3-
set -e
3+
set -euo pipefail
44

55
SCRIPT_PATH=$(dirname "$BASH_SOURCE")
66
AMICI_PATH=$(cd "$SCRIPT_PATH"/.. && pwd)
77

88
DOXYGEN_DIR="${AMICI_PATH}"/ThirdParty/doxygen
99
cd "${AMICI_PATH}"/ThirdParty
1010
if [[ ! -d ${DOXYGEN_DIR} ]]; then
11-
# git clone --depth 1 https://github.com/doxygen/doxygen.git "${DOXYGEN_DIR}"
12-
git clone --single-branch --branch Release_1_9_7 --depth 1 https://github.com/doxygen/doxygen.git "${DOXYGEN_DIR}"
11+
git clone --single-branch \
12+
--branch Release_1_9_7 \
13+
--depth 1 \
14+
-c advice.detachedHead=false \
15+
https://github.com/doxygen/doxygen.git "${DOXYGEN_DIR}"
1316
fi
1417

1518
cd "${DOXYGEN_DIR}"

0 commit comments

Comments
 (0)