From 338cec40f65299504b07f6f4e07a66707eb2b851 Mon Sep 17 00:00:00 2001
From: Bastien Le Querrec <blq@laquadrature.net>
Date: Thu, 21 Mar 2024 00:57:42 +0100
Subject: [PATCH] =?UTF-8?q?ci:=20n'analyse=20pas=20les=20pr=C3=A9fectures?=
 =?UTF-8?q?=20s'il=20a=20=C3=A9t=C3=A9=20demand=C3=A9=20de=20compiler=20l'?=
 =?UTF-8?q?image=20docker?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitlab-ci.yml | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c9bfb75..9753dd8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -43,8 +43,6 @@ test_ppparis:
   - source bin/activate
   - python ./cli.py --pref ppparis
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -56,6 +54,8 @@ test_ppparis:
     - data/ppparis/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 install:
   stage: install
@@ -72,6 +72,8 @@ install:
     - bin/
     - lib/
     - pyvenv.cfg
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 test_pref06:
   stage: test
@@ -87,8 +89,6 @@ test_pref06:
   - /etc/init.d/tor start
   - python ./cli.py --pref pref06
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -100,6 +100,8 @@ test_pref06:
     - data/pref06/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 test_pref13:
   stage: test
@@ -115,8 +117,6 @@ test_pref13:
   - /etc/init.d/tor start
   - python ./cli.py --pref pref13
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -128,6 +128,8 @@ test_pref13:
     - data/pref13/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 test_pref34:
   stage: test
@@ -143,8 +145,6 @@ test_pref34:
   - /etc/init.d/tor start
   - python ./cli.py --pref pref34
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -156,6 +156,8 @@ test_pref34:
     - data/pref34/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 test_pref35:
   stage: test
@@ -171,8 +173,6 @@ test_pref35:
   - /etc/init.d/tor start
   - python ./cli.py --pref pref35
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -184,6 +184,8 @@ test_pref35:
     - data/pref35/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 test_pref38:
   stage: test
@@ -199,8 +201,6 @@ test_pref38:
   - /etc/init.d/tor start
   - python ./cli.py --pref pref38
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -212,6 +212,8 @@ test_pref38:
     - data/pref38/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 test_pref59:
   stage: test
@@ -227,8 +229,6 @@ test_pref59:
   - /etc/init.d/tor start
   - python ./cli.py --pref pref59
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -240,6 +240,8 @@ test_pref59:
     - data/pref59/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 test_pref62:
   stage: test
@@ -255,8 +257,6 @@ test_pref62:
   - /etc/init.d/tor start
   - python ./cli.py --pref pref62
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -268,6 +268,8 @@ test_pref62:
     - data/pref62/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
 test_pref69:
   stage: test
@@ -283,8 +285,6 @@ test_pref69:
   - /etc/init.d/tor start
   - python ./cli.py --pref pref69
   retry: 2
-  only:
-  - main
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
@@ -296,3 +296,5 @@ test_pref69:
     - data/pref69/*.txt
     - output.log
     expire_in: 1 hour
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
-- 
GitLab