Skip to content

Commit

Permalink
GHA: Clean up custom doxygen (#2201)
Browse files Browse the repository at this point in the history
Handle installation and dependencies in one single place.
  • Loading branch information
dweindl authored Nov 16, 2023
1 parent 17f85fb commit acf526a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
20 changes: 20 additions & 0 deletions .github/actions/setup-doxygen/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Set up doxygen
description: |
Download, build, and install doxygen.
runs:
using: "composite"
steps:
- name: Install apt dependencies for doxygen
run: |
sudo apt-get update \
&& sudo apt-get install -y \
bison \
ragel \
graphviz \
texlive-latex-extra
shell: bash

- name: Download and build doxygen
run: sudo scripts/downloadAndBuildDoxygen.sh
shell: bash
27 changes: 6 additions & 21 deletions .github/workflows/test_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ on:
jobs:
doxygen:
name: Test Doxygen

runs-on: ubuntu-22.04

strategy:
Expand All @@ -32,26 +31,14 @@ jobs:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow

- name: apt
run: |
sudo apt-get update \
&& sudo apt-get install -y \
bison \
ragel \
graphviz \
texlive-latex-extra
- name: Build doxygen
run: |
sudo scripts/downloadAndBuildDoxygen.sh
- name: Set up doxygen
uses: ./.github/actions/setup-doxygen

- name: Run doxygen
run: |
scripts/run-doxygen.sh
run: scripts/run-doxygen.sh

sphinx:
name: Test Sphinx

runs-on: ubuntu-22.04

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

- name: Build doxygen
run: |
sudo scripts/downloadAndBuildDoxygen.sh
- name: Set up doxygen
uses: ./.github/actions/setup-doxygen

# install amici dependencies
- name: apt
Expand All @@ -90,5 +76,4 @@ jobs:
sudo scripts/downloadAndBuildSwig.sh
- name: sphinx
run: |
scripts/run-sphinx.sh
run: scripts/run-sphinx.sh
9 changes: 6 additions & 3 deletions scripts/downloadAndBuildDoxygen.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#!/usr/bin/env bash
# Download and build Doxygen (in case apt or homebrew version is buggy again)
set -e
set -euo pipefail

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

DOXYGEN_DIR="${AMICI_PATH}"/ThirdParty/doxygen
cd "${AMICI_PATH}"/ThirdParty
if [[ ! -d ${DOXYGEN_DIR} ]]; then
# git clone --depth 1 https://github.com/doxygen/doxygen.git "${DOXYGEN_DIR}"
git clone --single-branch --branch Release_1_9_7 --depth 1 https://github.com/doxygen/doxygen.git "${DOXYGEN_DIR}"
git clone --single-branch \
--branch Release_1_9_7 \
--depth 1 \
-c advice.detachedHead=false \
https://github.com/doxygen/doxygen.git "${DOXYGEN_DIR}"
fi

cd "${DOXYGEN_DIR}"
Expand Down

0 comments on commit acf526a

Please sign in to comment.