From 5843fbbdcd66e931e2de04677c9c71af0498ab53 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Tue, 19 Jan 2021 14:48:28 +0100
Subject: [PATCH] [bob/devtools/data/gitlab-ci] Prepare CI files for macos+arm
 integration

---
 .gitlab-ci.yml                                  | 11 ++++++-----
 bob/devtools/data/gitlab-ci/base-build.yaml     |  7 ++++---
 bob/devtools/data/gitlab-ci/nightlies.yaml      |  5 +++--
 bob/devtools/data/gitlab-ci/noarch.yaml         | 14 ++++++++------
 bob/devtools/data/gitlab-ci/single-package.yaml | 17 +++++++++--------
 doc/macos.rst                                   |  2 +-
 doc/templates.rst                               |  4 ++--
 7 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 61c7daf2..b0147122 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -48,10 +48,11 @@ build_linux:
     key: "linux-cache"
 
 
-build_macosx:
+build_macos_intel:
   extends: .build_template
   tags:
-    - macosx
+    - macos
+    - intel
   script:
     - python3 ./bob/devtools/bootstrap.py -vv build
     - source ${CONDA_ROOT}/etc/profile.d/conda.sh
@@ -62,7 +63,7 @@ build_macosx:
       - ${CONDA_ROOT}/conda-bld/osx-64/*.conda
       - ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
   cache:
-    key: "macosx-cache"
+    key: "macos-intel-cache"
 
 
 # Deploy targets
@@ -80,7 +81,7 @@ build_macosx:
     - bdt ci clean -vv
   dependencies:
     - build_linux
-    - build_macosx
+    - build_macos_intel
   tags:
     - docker
   cache:
@@ -122,7 +123,7 @@ pypi:
     - bdt ci clean -vv
   dependencies:
     - build_linux
-    - build_macosx
+    - build_macos_intel
   tags:
     - docker
   cache:
diff --git a/bob/devtools/data/gitlab-ci/base-build.yaml b/bob/devtools/data/gitlab-ci/base-build.yaml
index 629f7e3b..5da2248c 100644
--- a/bob/devtools/data/gitlab-ci/base-build.yaml
+++ b/bob/devtools/data/gitlab-ci/base-build.yaml
@@ -40,9 +40,10 @@ build_linux:
     key: "linux-cache"
 
 
-build_macosx:
+build_macos_intel:
   extends: .build_template
   tags:
-    - macosx
+    - macos
+    - intel
   cache:
-    key: "macosx-cache"
+    key: "macos-intel-cache"
diff --git a/bob/devtools/data/gitlab-ci/nightlies.yaml b/bob/devtools/data/gitlab-ci/nightlies.yaml
index acfdd376..fdd80009 100644
--- a/bob/devtools/data/gitlab-ci/nightlies.yaml
+++ b/bob/devtools/data/gitlab-ci/nightlies.yaml
@@ -50,12 +50,13 @@ build_linux_37:
   cache:
     key: 'build-py37'
 
-build_macosx_37:
+build_macos_intel_37:
   extends: .build_template
   variables:
     PYTHON_VERSION: "3.7"
   tags:
-    - macosx
+    - macos
+    - intel
   cache:
     key: 'build-py37'
 
diff --git a/bob/devtools/data/gitlab-ci/noarch.yaml b/bob/devtools/data/gitlab-ci/noarch.yaml
index 2adf7fd2..b9314488 100644
--- a/bob/devtools/data/gitlab-ci/noarch.yaml
+++ b/bob/devtools/data/gitlab-ci/noarch.yaml
@@ -66,14 +66,15 @@ build_linux:
       - ${CONDA_ROOT}/conda-bld/noarch/*.tar.bz2
 
 
-build_macosx:
+build_macos_intel:
   variables:
     PYTHON_VERSION: "3.7"
   cache:
     key: "build"
   extends: .build_template
   tags:
-    - macosx
+    - macos
+    - intel
 
 
 # Test targets (not normally used)
@@ -95,10 +96,11 @@ build_macosx:
   image: docker.idiap.ch/bob/docker-images/c3i-linux-64
 
 
-.test_macosx_template:
+.test_macos_intel_template:
   extends: .test_template
   tags:
-    - macosx
+    - macos
+    - intel
 
 
 # Deploy targets
@@ -110,7 +112,7 @@ build_macosx:
     - bdt ci clean -vv
   dependencies:
     - build_linux
-    - build_macosx
+    - build_macos_intel
   tags:
     - docker
   cache:
@@ -149,7 +151,7 @@ pypi:
     - bdt ci clean -vv
   dependencies:
     - build_linux
-    - build_macosx
+    - build_macos_intel
   tags:
     - docker
   cache:
diff --git a/bob/devtools/data/gitlab-ci/single-package.yaml b/bob/devtools/data/gitlab-ci/single-package.yaml
index e78046f8..7938372e 100644
--- a/bob/devtools/data/gitlab-ci/single-package.yaml
+++ b/bob/devtools/data/gitlab-ci/single-package.yaml
@@ -56,18 +56,19 @@ stages:
       - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
 
 
-.build_macosx_template:
+.build_macos_intel_template:
   extends: .build_template
   tags:
-    - macosx
+    - macos
+    - intel
   artifacts:
     paths:
       - ${CONDA_ROOT}/conda-bld/osx-64/*.conda
       - ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
 
 
-build_macosx_37:
-  extends: .build_macosx_template
+build_macos_intel_37:
+  extends: .build_macos_intel_template
   variables:
     PYTHON_VERSION: "3.7"
   cache:
@@ -112,10 +113,10 @@ build_linux_37:
   image: docker.idiap.ch/bob/docker-images/c3i-linux-64
 
 
-.test_macosx_template:
+.test_macos_intel_template:
   extends: .test_template
   tags:
-    - macosx
+    - macos_intel
 
 
 # Deploy targets
@@ -127,7 +128,7 @@ build_linux_37:
     - bdt ci clean -vv
   dependencies:
     - build_linux_37
-    - build_macosx_37
+    - build_macos_intel_37
   tags:
     - docker
   cache:
@@ -166,7 +167,7 @@ pypi:
     - bdt ci clean -vv
   dependencies:
     - build_linux_37
-    - build_macosx_37
+    - build_macos_intel_37
   tags:
     - docker
   cache:
diff --git a/doc/macos.rst b/doc/macos.rst
index 107918d1..9e1bc6fb 100644
--- a/doc/macos.rst
+++ b/doc/macos.rst
@@ -173,7 +173,7 @@ Inside the file ``/Users/admin/cron.sh``, put the following contents:
 
 .. code-block:: sh
 
-   /bin/bash <(curl -s https://gitlab.idiap.ch/bob/bob.devtools/raw/master/doc/macos-ci-install/update-ci.sh) 2>&1 | mailx -s "Software update (hostname|cimacosx)" your.email@idiap.ch
+   /bin/bash <(curl -s https://gitlab.idiap.ch/bob/bob.devtools/raw/master/doc/macos-ci-install/update-ci.sh) 2>&1 | mailx -s "Software update (hostname|cimacos)" your.email@idiap.ch
 
 .. note::
 
diff --git a/doc/templates.rst b/doc/templates.rst
index bc7ceddc..6a5b92ee 100644
--- a/doc/templates.rst
+++ b/doc/templates.rst
@@ -96,7 +96,7 @@ You also need to enable the following options - through gitlab - on your project
    the "Deploy Keys" for our builders (all `conda-*` related servers) are
    enabled
 3. Visit the "Runners" section of your package settings and enable all conda
-   runners, for linux and macosx variants
+   runners, for linux and macos (intel or arm) variants
 4. Go into the "Variables" section of your package setup and **add common
    variables** corresponding to the usernames and passwords for uploading
    wheels and documentation tar balls to our (web DAV) server, as well as PyPI
@@ -399,7 +399,7 @@ You also remember to enable the following options on your project:
 
 1. In the project "Settings" page, make sure builds are enabled
 2. Visit the "Runners" section of your package settings and enable all runners
-   with the `docker` and `macosx` tags.
+   with the `docker` and `macos` tags.
 3. Setup the coverage regular expression under "CI/CD pipelines" to have the
    value `^TOTAL.*\s+(\d+\%)$`, which is adequate for figuring out the output
    of `coverage report`
-- 
GitLab