Skip to content

Commit 9451446

Browse files
pks-tgitster
authored andcommitted
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 87eccc3 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 87a0bdb commit 9451446

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

ci/test-documentation.sh

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ filter_log () {
1515
"$1"
1616
}
1717

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+
1825
make check-builtins
1926
make check-docs
2027

@@ -23,10 +30,7 @@ make doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)
2330
cat stderr.raw
2431
filter_log stderr.raw >stderr.log
2532
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
3034

3135
rm -f stdout.log stderr.log stderr.raw
3236
check_unignored_build_artifacts
@@ -37,10 +41,21 @@ make USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)
3741
cat stderr.raw
3842
filter_log stderr.raw >stderr.log
3943
test ! -s stderr.log
40-
test -s Documentation/git.html
41-
grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html
44+
check_docs . Asciidoctor
4245

4346
rm -f stdout.log stderr.log stderr.raw
4447
check_unignored_build_artifacts
4548

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+
4661
save_good_tree

0 commit comments

Comments
 (0)