-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (112 loc) · 4.21 KB
/
doxygen.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Generate documentation
on:
push:
branches: [ "dev" ]
workflow_dispatch:
permissions:
contents: read
id-token: write
pages: write
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
CMAKE_PRESET: doxygen
CMAKE_BUILD_PRESET: generate-doxygen
DOXYGEN_VERSION: "1.10.0"
GRAPHVIZ_VERSION: '2.42.2-6'
DEPS_PATH: deps
home: /home/runner
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- name: Setup GitHub Actions
uses: actions/checkout@v4
- name: Cache CMake buildsystem
uses: actions/cache@v4
with:
path: "${{ github.workspace }}/build/${{ env.CMAKE_PRESET }}"
key: cmake-build-doxygen-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: cmake-build-doxygen-
- name: Cache Graphviz dependency
uses: actions/cache@v4
id: graphviz-cache
with:
path: "${{ env.home }}/${{ env.DEPS_PATH }}/graphviz"
key: graphviz-${{ env.GRAPHVIZ_VERSION }}
- name: Cache Doxygen dependency
uses: actions/cache@v4
id: doxygen-cache
with:
path: "${{ env.home }}/${{ env.DEPS_PATH }}/doxygen"
key: doxygen-${{ env.DOXYGEN_VERSION }}
- name: Update apt repos
if: ${{ !steps.graphviz-cache.outputs.cache-hit }}
run: sudo apt update
- name: Install Doxygen
env:
CACHE_HIT: ${{ steps.doxygen-cache.outputs.cache-hit }}
CACHE_PATH: ${{ env.home }}/${{ env.DEPS_PATH }}/doxygen
VERSION: ${{ env.DOXYGEN_VERSION }}
continue-on-error: false
run: |
if [[ "${CACHE_HIT}" == 'true' ]]; then
cd ${CACHE_PATH}
sudo make install
else
cd /tmp
wget https://github.com/doxygen/doxygen/releases/download/Release_${VERSION//./_}/doxygen-${VERSION}.linux.bin.tar.gz
tar xzvf doxygen-${VERSION}.linux.bin.tar.gz
cd doxygen-${VERSION}
sudo make install
cd ..
mkdir -p ${CACHE_PATH}
rmdir ${CACHE_PATH}
mv doxygen-${VERSION} ${CACHE_PATH}
fi
- name: Install Graphviz
env:
VERSION: ${{ env.GRAPHVIZ_VERSION }}
CACHE_HIT: ${{ steps.graphviz-cache.outputs.cache-hit }}
CACHE_PATH: ${{ env.home }}/${{ env.DEPS_PATH }}/graphviz
continue-on-error: false
run: |
if [[ "${CACHE_HIT}" == 'true' ]]; then
sudo cp --verbose --force --recursive ${CACHE_PATH}/* /
else
sudo apt install -y graphviz=${VERSION}
mkdir -p $CACHE_PATH
sudo dpkg -L graphviz | \
while IFS= read -r f; do \
if test -f $f; then \
echo $f; \
fi; \
done | \
xargs cp --parents --target-directory ${CACHE_PATH}
fi
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake --preset ${{ env.CMAKE_PRESET }}
- name: Generate Documentation
# Build the program with the given configuration
run: cmake --build --preset ${{ env.CMAKE_BUILD_PRESET }}
- name: Upload documentation artifacts
uses: actions/upload-pages-artifact@v3
if: ${{ !env.ACT }}
with:
name: Docs
path: ${{ github.workspace }}/build/${{ env.CMAKE_PRESET }}/docs/html
retention-days: 7
deploy:
runs-on: ubuntu-latest
needs: build
if: ${{ !github.event.act }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: Docs