ci: perform build and smoke tests for Meson docs
Our "documentation" CI job performs a couple of tests against our documentation. Part of these tests is to check whether documentation builds at all and whether it spits out the expected set of files. We don't yet have such a test for Meson, which means that we wouldn't notice at all if building the documentation were to break. As a result, breakages as fixed by 87eccc3a81d (meson: fix building technical and howto docs, 2025-03-02) are easy to go unnoticed. Address this test gap by starting to build both manpages and HTML sites as part of the CI job. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Mar 12, 2025 at 15:28 UTC
9451446c61e766ada8fbb88e6acee98408091317
1 file changed
+21
-6
ci/test-documentation.sh
+21
-6
@@ -15,6 +15,13 @@ filter_log () {
15
"$1"
16
}
17
18
+check_docs () {
19
+ test -s "$1"/Documentation/git.html &&
20
+ test -s "$1"/Documentation/git.xml &&
21
+ test -s "$1"/Documentation/git.1 &&
22
+ grep "<meta name=\"generator\" content=\"$2 " "$1"/Documentation/git.html
23
+}
24
+
25
make check-builtins
26
make check-docs
27
@@ -23,10 +30,7 @@ make doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)
30
cat stderr.raw
31
filter_log stderr.raw >stderr.log
32
test ! -s stderr.log
26
-test -s Documentation/git.html
27
-test -s Documentation/git.xml
28
-test -s Documentation/git.1
29
-grep '<meta name="generator" content="AsciiDoc ' Documentation/git.html
33
+check_docs . AsciiDoc
34
35
rm -f stdout.log stderr.log stderr.raw
36
check_unignored_build_artifacts
@@ -37,10 +41,21 @@ make USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)
41
cat stderr.raw
42
filter_log stderr.raw >stderr.log
43
test ! -s stderr.log
40
-test -s Documentation/git.html
41
-grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html
44
+check_docs . Asciidoctor
45
46
rm -f stdout.log stderr.log stderr.raw
47
check_unignored_build_artifacts
48
49
+# Build docs with Meson and AsciiDoc
50
+meson setup build-asciidoc -Ddocs=html,man -Ddocs_backend=asciidoc
51
+meson compile -C build-asciidoc
52
+check_docs build-asciidoc AsciiDoc
53
+rm -rf build-asciidoc
54
+
55
+# Build docs with Meson and AsciiDoctor
56
+meson setup build-asciidoctor -Ddocs=html,man -Ddocs_backend=asciidoctor
57
+meson compile -C build-asciidoctor
58
+check_docs build-asciidoctor Asciidoctor
59
+rm -rf build-asciidoctor
60
+
61
save_good_tree