From b8884770f100d3ffbdb21aaab225f1d1b122493c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 11 Oct 2023 12:24:00 +1000 Subject: [PATCH] CI: add a separate job for the documentation build The pages job is only run once we push to main, so any issues with the documentation build won't be picked up until it's too late. Split those up and build the doc in a separate job, the pages job simply takes the artifacts from that job and publishes them. --- .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++------------- .gitlab-ci/ci.template | 28 ++++++++++++++++++++++----- 2 files changed, 53 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9cae501..a75947d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -329,20 +329,8 @@ fedora:38@default-build: needs: - "fedora:38@container-prep" -debian:bullseye@default-build: +fedora:38@doc-build: stage: distro - extends: - - .build@template - - .fdo.distribution-image@debian - variables: - FDO_DISTRIBUTION_VERSION: 'bullseye' - FDO_DISTRIBUTION_TAG: $DEBIAN_TAG - needs: - - "debian:bullseye@container-prep" - - -pages: - stage: deploy extends: - .build@template - .fdo.distribution-image@fedora @@ -355,7 +343,36 @@ pages: - rm -rf public/ - mv "$MESON_BUILDDIR"/doc/protocol/ei/public/ public/ - mv "$MESON_BUILDDIR"/doc/html/ public/api + artifacts: + paths: + - public +debian:bullseye@default-build: + stage: distro + extends: + - .build@template + - .fdo.distribution-image@debian + variables: + FDO_DISTRIBUTION_VERSION: 'bullseye' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + needs: + - "debian:bullseye@container-prep" + + + +pages: + stage: deploy + extends: + - .build@template + - .fdo.distribution-image@fedora + variables: + FDO_DISTRIBUTION_VERSION: '38' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + MESON_ARGS: "-Ddocumentation=protocol,api" + script: + - echo "Nothing to do" + needs: + - "fedora:38@doc-build" only: refs: - main diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index cf4776f..5df0db7 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -338,6 +338,26 @@ minimum-meson@{{distro.name}}:{{version}}: needs: - "{{distro.name}}:{{version}}@container-prep" +{% if distro.name == pages.distro %} +{{distro.name}}:{{version}}@doc-build: + stage: distro + extends: + - .build@template + - .fdo.distribution-image@{{distro.name}} + variables: + FDO_DISTRIBUTION_VERSION: '{{version}}' + FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG + MESON_ARGS: "-Ddocumentation=protocol,api" + script: + - .gitlab-ci/meson-build.sh + - rm -rf public/ + - mv "$MESON_BUILDDIR"/doc/protocol/ei/public/ public/ + - mv "$MESON_BUILDDIR"/doc/html/ public/api + artifacts: + paths: + - public +{% endif %} + {% endfor %} {% endfor %} @@ -351,11 +371,9 @@ pages: FDO_DISTRIBUTION_TAG: ${{pages.distro.upper()}}_TAG MESON_ARGS: "-Ddocumentation=protocol,api" script: - - .gitlab-ci/meson-build.sh - - rm -rf public/ - - mv "$MESON_BUILDDIR"/doc/protocol/ei/public/ public/ - - mv "$MESON_BUILDDIR"/doc/html/ public/api - + - echo "Nothing to do" + needs: + - "{{pages.distro}}:{{pages.version}}@doc-build" only: refs: - main