
Unlike most other cases, we don't put the YAML-file in a ci-folder, because we already have one for the CI-specific docs. So let's just leave the YAML file directly in the docs-folder. This should fix the problem that any docs-changes that touches the CI-rules needs a full CI run just because of touching the root .gitlab-ci.yml file. This causes needless friction and wastes CI resources. Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21953>
66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
.docs-base:
|
|
variables:
|
|
BUILDER: html
|
|
extends:
|
|
- .fdo.ci-fairy
|
|
- .build-rules
|
|
artifacts:
|
|
expose_as: 'Documentation preview'
|
|
paths:
|
|
- public/
|
|
script:
|
|
- apk --no-cache add graphviz doxygen
|
|
- pip3 install sphinx===5.1.1 breathe===4.34.0 mako===1.2.3 sphinx_rtd_theme===1.0.0
|
|
- docs/doxygen-wrapper.py --out-dir=docs/doxygen_xml
|
|
- sphinx-build -W -b $BUILDER docs public
|
|
|
|
pages:
|
|
extends: .docs-base
|
|
stage: deploy
|
|
needs: []
|
|
rules:
|
|
- !reference [.no_scheduled_pipelines-rules, rules]
|
|
- if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_COMMIT_BRANCH'
|
|
changes: &docs-or-ci
|
|
- docs/**/*
|
|
- .gitlab-ci.yml
|
|
when: always
|
|
# Other cases default to never
|
|
|
|
test-docs:
|
|
extends: .docs-base
|
|
# Cancel job if a newer commit is pushed to the same branch
|
|
interruptible: true
|
|
stage: deploy
|
|
needs: []
|
|
rules:
|
|
- !reference [.no_scheduled_pipelines-rules, rules]
|
|
- if: '$CI_COMMIT_BRANCH && $CI_PROJECT_NAMESPACE != "mesa"'
|
|
changes: *docs-or-ci
|
|
when: manual
|
|
# Other cases default to never
|
|
|
|
test-docs-mr:
|
|
extends:
|
|
- test-docs
|
|
needs:
|
|
- sanity
|
|
rules:
|
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
changes: *docs-or-ci
|
|
when: on_success
|
|
# Other cases default to never
|
|
|
|
linkcheck-docs:
|
|
extends: .docs-base
|
|
# Cancel job if a newer commit is pushed to the same branch
|
|
interruptible: true
|
|
stage: deploy
|
|
needs: []
|
|
rules:
|
|
- !reference [.scheduled_pipeline-rules, rules]
|
|
allow_failure: true
|
|
variables:
|
|
BUILDER: linkcheck
|
|
|