Skip to content

Commit 702b285

Browse files
authored
Merge pull request #847 from uyjulian/doxygen_ci_improvements
Build and upload Doxygen artifact for CI
2 parents 2010be9 + e7ac0e0 commit 702b285

4 files changed

Lines changed: 55 additions & 12 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
11
name: github pages
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- master
4+
push: {}
5+
pull_request: {}
6+
workflow_dispatch: {}
7+
8+
env:
9+
DEBIAN_FRONTEND: noninteractive
10+
TZ: Japan
811

912
jobs:
10-
build:
13+
build-docs:
1114
runs-on: ubuntu-latest
15+
timeout-minutes: 20
16+
container:
17+
image: ubuntu:20.04
18+
options: "--user 0"
1219

1320
steps:
14-
- uses: actions/checkout@v4
21+
- name: Set up base environment
22+
run: apt-get -y update && apt-get -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install build-essential git doxygen graphviz p7zip-full
23+
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Mark all git directories safe
28+
run: git config --global --add safe.directory '*'
1529

16-
- name: clone custom doxygen CSS
30+
- name: Build documentation
1731
run: |
18-
git clone https://github.com/jothepro/doxygen-awesome-css
32+
export PS2DEV=$PWD/ps2dev
33+
export PS2SDK=$PS2DEV/ps2sdk
34+
make -j $(getconf _NPROCESSORS_ONLN) ONLY_HOST_TOOLS=1 docs
35+
36+
- name: Upload artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: ${{ github.event.repository.name }}-docs
40+
path: ./*.tgz
1941

20-
- name: Doxygen documentation generation
21-
uses: mattnotmitt/doxygen-action@v1
42+
publish-github-pages:
43+
needs: [build-docs]
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 20
46+
47+
steps:
48+
- name: Download all artifacts
49+
uses: actions/download-artifact@v4
50+
51+
- name: Extract artifact
52+
run: |
53+
mkdir -p docs/html
54+
tar -xpzf */*.tgz -C docs/html
2255
2356
- name: Deploy
57+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
2458
uses: peaceiris/actions-gh-pages@v3
2559
with:
2660
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*.swp
2222
*.tmp
2323
*.bin
24+
*.tgz
2425

2526
#
2627
# files that we don't want to ignore

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2628,5 +2628,5 @@ DOT_CLEANUP = YES
26282628
GENERATE_TREEVIEW = YES # optional. Also works without treeview
26292629
DISABLE_INDEX = NO
26302630
FULL_SIDEBAR = NO
2631-
HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css
2631+
HTML_EXTRA_STYLESHEET = docs/doxygen-awesome-css/doxygen-awesome.css
26322632

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,15 @@ clean_dependencies:
124124
$(MAKEREC) $(PS2SDKSRC)/common/external_deps clean ; \
125125
fi
126126

127-
docs:
127+
DOXYGEN_OUTPUT_ARCHIVE = doxygen-output.tgz
128+
129+
docs/doxygen-awesome-css:
130+
git clone https://github.com/jothepro/doxygen-awesome-css.git $@
131+
132+
$(DOXYGEN_OUTPUT_ARCHIVE): Doxyfile docs/doxygen-awesome-css
128133
doxygen
134+
tar -cpzf $@ -C docs/html .
135+
136+
docs: $(DOXYGEN_OUTPUT_ARCHIVE)
129137

130138
include Defs.make

0 commit comments

Comments
 (0)