From 895c0cf8ebf72078cc3629bf42820668d6b096c3 Mon Sep 17 00:00:00 2001
From: Bastien Le Querrec <blq@laquadrature.net>
Date: Mon, 11 Nov 2024 20:32:21 +0100
Subject: [PATCH] =?UTF-8?q?ci:=20ajoute=20une=20=C3=A9tape=20d'analyse?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitlab-ci.yml | 41 +++++++++++++++++++++++++++++++++--------
 1 file changed, 33 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8f55358..4d2ace2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,19 +4,44 @@ variables:
 
 stages:
   - lint
+  - analyze
 
 lint:
   stage: lint
   image: $DOCKER_IMAGE
   script:
-  - pip3 install virtualenv
-  - virtualenv .
-  - source bin/activate
-  - pip3 install -r requirements.txt
-  - bin/pycodestyle --first --show-source --ignore=E501 *.py
+    - pip3 install virtualenv
+    - virtualenv .
+    - source bin/activate
+    - pip3 install -r requirements.txt
+    - bin/pycodestyle --first --show-source --ignore=E501 *.py
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
-    - bin/
-    - lib/
-    - ./*.latest.txt
+      - bin/
+      - lib/
+  allow_failure: true
+  artifacts:
+    paths:
+      - ./*.latest.txt
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push"
+
+analyze:
+  stage: analyze
+  image: $DOCKER_IMAGE
+  script:
+    - pip3 install virtualenv
+    - virtualenv .
+    - source bin/activate
+    - pip3 install -r requirements.txt
+    - source bin/activate
+    - ./cli.py -c /dev/null
+  cache:
+    key: $CI_COMMIT_REF_SLUG
+    paths:
+      - bin/
+      - lib/
+  artifacts:
+    paths:
+      - ./*.latest.txt
-- 
GitLab