From a32cb674edd03839da559dfe04b543b4d508045c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 13 Feb 2022 03:28:00 -0600
Subject: [PATCH 3/7] s!build docs as a separate task..

I believe this'll automatically show up as a separate "column" on the cfbot
page.
---
 .cirrus.yml | 101 +++++++++++++++++++++++++++++++---------------------
 1 file changed, 61 insertions(+), 40 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index f21b249b6f..73b0baeaa7 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -450,6 +450,10 @@ task:
 task:
   name: CompilerWarnings
 
+  # To limit unnecessary work only run this once the normal linux test succeeds
+  depends_on:
+    - Linux - Debian Bullseye
+
   env:
     CPUS: 4
     BUILD_JOBS: 4
@@ -478,13 +482,6 @@ task:
     clang -v
     export
 
-    git remote -v
-    git branch -a
-    git remote add postgres https://github.com/postgres/postgres
-    time git fetch -v postgres master
-    git log -1 postgres/master
-    git diff --name-only postgres/master..
-
   ccache_cache:
     folder: $CCACHE_DIR
 
@@ -557,38 +554,62 @@ task:
       make -s -j${BUILD_JOBS} clean
       time make -s -j${BUILD_JOBS} world-bin
 
-  ###
-  # Verify docs can be built
-  ###
-  always:
-    docs_build_script: |
-      # Do nothing if the patch doesn't update doc:
-      git diff --name-only --cherry-pick --exit-code postgres/master... doc && exit
-
-      # Exercise HTML and other docs:
-      ./configure >/dev/null
-      make -s -C doc
-      cp -r doc new-docs
-
-      # Build HTML docs from the parent commit
-      git checkout postgres/master -- doc
-      make -s -C doc clean
-      make -s -C doc html
-      cp -r doc old-docs
-
-      # Copy HTML which differ into html_docs
-      # This will show any files which differ from files generated from postgres/master.
-      # Commits to postgres/master which affect doc/ will cause more files to be
-      # included until the patch is rebased.
-      mkdir html_docs
-      cp new-docs/src/sgml/html/*.css new-docs/src/sgml/html/*.svg html_docs/
-      for f in `git diff --no-index --name-only old-docs/src/sgml/html new-docs/src/sgml/html`
-      do
-        cp $f html_docs/
-      done
-
-    html_docs_artifacts:
-      paths: ['html_docs/**/*.html', 'html_docs/**/*.png', 'html_docs/**/*.css']
-
   always:
     upload_caches: ccache
+
+
+# Verify docs can be built, and upload changed docs as artifacts
+task:
+  name: HTML docs
+
+  env:
+    CPUS: 1
+
+  only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(docs|html).*'
+
+  container:
+    image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest
+    cpu: $CPUS
+
+  sysinfo_script: |
+    id
+    uname -a
+    cat /proc/cmdline
+    ulimit -a -H && ulimit -a -S
+    export
+
+    git remote -v
+    git branch -a
+    git remote add postgres https://github.com/postgres/postgres
+    time git fetch -v postgres master
+    git log -1 postgres/master
+    git diff --name-only postgres/master..
+
+  docs_build_script: |
+    # Do nothing if the patch doesn't update doc:
+    git diff --name-only --cherry-pick --exit-code postgres/master... doc && exit
+
+    # Exercise HTML and other docs:
+    ./configure >/dev/null
+    make -s -C doc
+    cp -r doc new-docs
+
+    # Build HTML docs from the parent commit
+    git checkout postgres/master -- doc
+    make -s -C doc clean
+    make -s -C doc html
+    cp -r doc old-docs
+
+    # Copy HTML which differ into html_docs
+    # This will show any files which differ from files generated from postgres/master.
+    # Commits to postgres/master which affect doc/ will cause more files to be
+    # included until the patch is rebased.
+    mkdir html_docs
+    cp new-docs/src/sgml/html/*.css new-docs/src/sgml/html/*.svg html_docs/
+    for f in `git diff --no-index --name-only old-docs/src/sgml/html new-docs/src/sgml/html`
+    do
+      cp $f html_docs/
+    done
+
+  html_docs_artifacts:
+    paths: ['html_docs/**/*.html', 'html_docs/**/*.png', 'html_docs/**/*.css']
-- 
2.17.1

