Merge branch '3037-docs-ci' into 'main'

ci: Build docs artifacts for deployment to docs.gtk.org

See merge request GNOME/glib!3768
This commit is contained in:
Philip Withnall 2023-12-21 12:32:34 +00:00
commit 385641572d
5 changed files with 39 additions and 17 deletions

View File

@ -33,6 +33,15 @@ variables:
variables:
- $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_NAMESPACE == "GNOME"
# As above, but does get executed on merge into `origin/main`. For use with
# updating code coverage results and docs builds.
.only-default-and-merges:
only:
- branches
except:
refs:
- tags
# Some jobs run on CI runners which dont have good isolation between CI jobs,
# and dont have much available resource. Limit those jobs to only ones on the
# origin repository (GNOME/glib), rather than peoples forks. Code in the origin
@ -103,7 +112,7 @@ style-check-mandatory:
fedora-x86_64:
extends:
- .build-linux
- .only-default
- .only-default-and-merges
image: $FEDORA_IMAGE
stage: build
needs: []
@ -121,12 +130,20 @@ fedora-x86_64:
-Dinstalled_tests=true
-Ddocumentation=true
-Dintrospection=enabled
-Dman=true
_build
- meson compile -C _build
- mkdir -p _coverage
- lcov --config-file .lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
- .gitlab-ci/run-tests.sh
- lcov --config-file .lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
# Copy the built documentation to an artifact directory. The build for docs.gtk.org
# can then pull it from there — see https://gitlab.gnome.org/GNOME/gtk/-/blob/docs-gtk-org/README.md
- mkdir -p _reference/
- mv _build/docs/reference/glib/glib/ _reference/glib/
- mv _build/docs/reference/gmodule/gmodule/ _reference/gmodule/
- mv _build/docs/reference/gobject/gobject/ _reference/gobject/
- mv _build/docs/reference/gio/gio/ _reference/gio/
artifacts:
reports:
junit:
@ -139,16 +156,8 @@ fedora-x86_64:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
- "_build/docs/reference/glib/glib-undeclared.txt"
- "_build/docs/reference/glib/glib-undocumented.txt"
- "_build/docs/reference/glib/glib-unused.txt"
- "_build/docs/reference/gobject/gobject-undeclared.txt"
- "_build/docs/reference/gobject/gobject-undocumented.txt"
- "_build/docs/reference/gobject/gobject-unused.txt"
- "_build/docs/reference/gio/gio-undeclared.txt"
- "_build/docs/reference/gio/gio-undocumented.txt"
- "_build/docs/reference/gio/gio-unused.txt"
- "_coverage"
- "_reference"
debian-stable-x86_64:
extends:
@ -746,13 +755,14 @@ dist-job:
- meson subprojects download
- meson setup ${MESON_COMMON_OPTIONS} --buildtype release -Ddocumentation=true -Dman=true _build
- meson dist -C _build
- ninja -C _build glib-doc gobject-doc gio-doc
- tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
- tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
- tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
- tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib glib
- tar -c -J -f "gmodule-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gmodule gmodule
- tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject gobject
- tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio gio
artifacts:
paths:
- "${CI_PROJECT_DIR}/_build/glib-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/gmodule-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/gobject-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/gio-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"

View File

@ -1,4 +1,10 @@
#!/usr/bin/env python3
#
# Copyright © 2022 Collabora, Ltd.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Xavier Claessens
"""
This script checks Meson configuration logs to verify no installed file is

View File

@ -8,7 +8,9 @@ if get_option('man')
output: page + '.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir)
install_dir: man1_dir,
install_tag: 'doc',
)
endforeach
endif

View File

@ -7,7 +7,9 @@ if get_option('man')
output: page + '.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir)
install_dir: man1_dir,
install_tag: 'doc',
)
endforeach
endif

View File

@ -6,7 +6,9 @@ if get_option('man')
output: page + '.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir)
install_dir: man1_dir,
install_tag: 'doc',
)
endforeach
endif