aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2023-11-09 15:29:02 -0500
committerNick Mathewson <nickm@torproject.org>2023-11-09 16:42:47 -0500
commit964a8aca24913d498a2677686e88d96b118ad536 (patch)
tree8ffc92b2cb35dbfac19b6fb2ceee7fba3a31be61 /.gitlab-ci.yml
parent784db7105d2ca3c42fe13069a1879136423915eb (diff)
downloadtorspec-964a8aca24913d498a2677686e88d96b118ad536.tar.gz
torspec-964a8aca24913d498a2677686e88d96b118ad536.zip
Tweak CI script for mermaid.
My goal here is to only run MMDC when building main and about to deploy it for the specs.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml34
1 files changed, 26 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6a00b5d..06942af 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,19 +1,29 @@
---
variables:
SITE_URL: spec.torproject.org
- MMDC: mmdc -p bin/ci-puppeteer-config.json
-# ^ re MMDC:
-# https://github.com/mermaid-js/mermaid-cli/blob/HEAD/docs/linux-sandbox-issue.md
-#
-# bin/ is the wrong place for that file
-# but I don't want to rename all of bin/ to maint/ right now.
build:
image: rust:bookworm
+ rules:
+ # We install mermaid-cli only when we are building for the
+ # actual website, since it is pretty expensive. If we switch to
+ # faster install tool, we should revisit that.
+ - if: '$CI_PROJECT_ROOT_NAMESPACE == "tpo" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+ variables:
+ MMDC: mmdc -p bin/ci-puppeteer-config.json
+ # ^ See note
+ # But we _do_ want to build unconditionally.
+ - when: always
script:
+ - env
- apt-get update && apt-get install -y git python3 python3-yaml
- ./bin/via-cargo-install-in-ci mdbook
- - ./bin/mermaid-cli-in-ci
+ - |
+ if test "$MMDC" != "" ; then
+ ./bin/mermaid-cli-in-ci
+ else
+ ./bin/via-cargo-install-in-ci mdbook-mermaid
+ fi
- ./bin/check_index
- ./bin/build_html
- mv html public
@@ -24,8 +34,16 @@ build:
paths:
- cache
+# Note re MMDC above:
+# https://github.com/mermaid-js/mermaid-cli/blob/HEAD/docs/linux-sandbox-issue.md
+#
+# bin/ is the wrong place for that file
+# but I don't want to rename all of bin/ to maint/ right now.
+
link-check:
image: rust:bookworm
+ rules:
+ - when: always
script:
- apt-get update && apt-get install -y git python3 python3-yaml linklint
- ./bin/via-cargo-install-in-ci mdbook
@@ -50,4 +68,4 @@ include:
# request.
pages:
rules:
- - if: '$CI_PROJECT_ROOT_NAMESPACE != "tpo" && $CI_PIPELINE_SOURCE == "merge_request"'
+ - if: '$CI_PROJECT_ROOT_NAMESPACE != "tpo" && $CI_PIPELINE_SOURCE == "merge_request_event"'