From b3e02403e0083dcd6f1683cfea64ac861c842627 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Tue, 8 Nov 2022 10:41:37 +0100
Subject: [PATCH] [data/gitlab-ci] Split linux/docker setup to avoid if
 conditions on before_script [ci skip]

---
 .pre-commit-config.yaml                         |  7 ++++---
 bob/devtools/data/gitlab-ci/single-package.yaml | 13 ++++++++++---
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 4badf4ce..c8ea4c9f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -7,12 +7,12 @@ repos:
       - id: isort
         args: [--settings-path, "pyproject.toml"]
   - repo: https://github.com/psf/black
-    rev: 22.3.0
+    rev: 22.10.0
     hooks:
       - id: black
         exclude: bob/devtools/templates/setup.py
   - repo: https://gitlab.com/pycqa/flake8
-    rev: 4.0.1
+    rev: 3.9.2
     hooks:
       - id: flake8
         exclude: |
@@ -21,7 +21,7 @@ repos:
                   deps/bob-devel/run_test.py
               )$
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.1.0
+    rev: v4.3.0
     hooks:
       - id: check-ast
         exclude: bob/devtools/templates/setup.py
@@ -33,4 +33,5 @@ repos:
       - id: check-added-large-files
         exclude: bob/devtools/templates/setup.py
       - id: check-yaml
+        args: ['--unsafe']
         exclude: .*/meta.*.yaml
diff --git a/bob/devtools/data/gitlab-ci/single-package.yaml b/bob/devtools/data/gitlab-ci/single-package.yaml
index b0396e42..329977c0 100644
--- a/bob/devtools/data/gitlab-ci/single-package.yaml
+++ b/bob/devtools/data/gitlab-ci/single-package.yaml
@@ -25,9 +25,6 @@ stages:
     - source ${CONDA_ROOT}/etc/profile.d/conda.sh
     # for conda inspect during builds (on macos)
     - conda activate base
-    - echo "CI_RUNNER_TAGS = '${CI_RUNNER_TAGS}'"
-    - if [[ "$CI_RUNNER_TAGS" =~ ^.*bob.*docker\|docker.*bob.*$ ]]; then echo "YES!!"; git config --global --add safe.directory ${CI_PROJECT_DIR}; fi
-    - bdt ci check -vv
   cache:
     paths:
       - miniconda.sh
@@ -61,6 +58,10 @@ stages:
   # make sure we use the same image as conda-forge:
   # https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/main/recipe/conda_build_config.yaml
   image: quay.io/condaforge/linux-anvil-cos7-x86_64
+  before_script:
+    - !reference [.bootstrap, before_script]
+    - git config --global --add safe.directory ${CI_PROJECT_DIR}
+    - bdt ci check -vv
   artifacts:
     paths:
       - ${CONDA_ROOT}/conda-bld/linux-64/*.conda
@@ -76,6 +77,9 @@ stages:
     - bob
     - macos
     - intel
+  before_script:
+    - !reference [.bootstrap, before_script]
+    - bdt ci check -vv
   artifacts:
     paths:
       - ${CONDA_ROOT}/conda-bld/osx-64/*.conda
@@ -88,6 +92,9 @@ stages:
     - bob
     - macos
     - arm
+  before_script:
+    - !reference [.bootstrap, before_script]
+    - bdt ci check -vv
   artifacts:
     paths:
       - ${CONDA_ROOT}/conda-bld/osx-arm64/*.conda
-- 
GitLab