-
Notifications
You must be signed in to change notification settings - Fork 66
82 lines (70 loc) · 2.79 KB
/
Copy pathdoc-check.yml
File metadata and controls
82 lines (70 loc) · 2.79 KB
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
on:
push:
branches:
- main
paths:
- '.github/workflows/doc-check.yml'
- '.github/build/scripts/compare-signatures.py'
- '.github/build/python/requirements.txt'
- 'docs/magick\+\+/**'
pull_request:
branches:
- main
paths:
- '.github/workflows/doc-check.yml'
- '.github/build/scripts/compare-signatures.py'
- '.github/build/python/requirements.txt'
- 'docs/magick\+\+/**'
workflow_dispatch:
schedule:
- cron: 0 6 * * 1
permissions:
contents: read
name: Documentation check for Magick++
jobs:
doxygen-check:
name: Documentation check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
with:
repository: ImageMagick/ImageMagick
path: ImageMagick
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 #v6.3.0
with:
python-version: 3.14
- name: Install Python dependencies
run: python -m pip install --user -r .github/build/python/requirements.txt --require-hashes
- name: Install Doxygen
run: sudo apt-get update && sudo apt-get install -y doxygen
- name: Generate Magick++ documentation
run: |
# Magick++.dox.in is an autoconf template; substitute the placeholders normally filled in by `configure`
cd ImageMagick/config
sed -e 's/@srcdir@/./g' -e 's/@PACKAGE_VERSION@/0.0.0/g' Magick++.dox.in > Magick++.dox
echo "WARN_IF_UNDOCUMENTED = NO" >> Magick++.dox
doxygen Magick++.dox
- name: Upload generated documentation
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
with:
name: magick++-doxygen-html
path: ImageMagick/www/api/Magick++
- name: Compare documentation
run: |
diff=""
# documentation files with function signatures that we can compare with their corresponding doxygen file (currently)
DOC_HTML=("Blob.html" "CoderInfo.html" "Geometry.html" "Image++.html" "Montage.html" "Pixels.html")
DOXY_HTML=("Blob.html" "CoderInfo.html" "Geometry.html" "Image.html" "Montage.html" "Pixels.html") # Image.html is the only one that differs from the doxygen file
for i in "${!DOC_HTML[@]}"; do
if ! python3 .github/build/scripts/compare-signatures.py docs/magick++/"${DOC_HTML[$i]}" ImageMagick/www/api/Magick++/classMagick_1_1"${DOXY_HTML[$i]}"; then
diff="true"
fi
done
if [ -n "$diff" ]; then
echo "Mismatches detected!" && exit 1
fi
exit 0