From 1186cbbddaa54ca181a2f9863c79d3e1add8de1c Mon Sep 17 00:00:00 2001
From: Bastien Le Querrec <blq@laquadrature.net>
Date: Thu, 7 Mar 2024 16:04:22 +0100
Subject: [PATCH] ci: utilise le dernier artifact comme cache

---
 .gitlab-ci.yml | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index aba24da..27f0409 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,16 +19,19 @@ install:
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
-      - bin/
-      - lib/
-      - pyvenv.cfg
+    - bin/
+    - lib/
+    - pyvenv.cfg
 
 test_ppparis:
   stage: test
   needs: [install]
   before_script:
-  - apt-get update && apt-get install --no-install-recommends -y python3 python3-virtualenv chromium-driver make xauth xvfb tesseract-ocr tesseract-ocr-eng tesseract-ocr-fra ocrmypdf
+  - apt-get update && apt-get install --no-install-recommends -y python3 python3-virtualenv chromium-driver make xauth xvfb tesseract-ocr tesseract-ocr-eng tesseract-ocr-fra ocrmypdf curl unzip
   - ln -s /usr/bin/python3 /usr/bin/python
+  - curl --location --output artifacts.zip "${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/${CI_COMMIT_BRANCH}/download?job=${CI_JOB_NAME}&job_token=${CI_JOB_TOKEN}" || true
+  - unzip artifacts.zip data/ppparis/* || true
+  - rm artifacts.zip || true
   script:
   - source bin/activate
   - python ./ppparis.py
@@ -37,7 +40,9 @@ test_ppparis:
   cache:
     key: $CI_COMMIT_REF_SLUG
     paths:
-      - data/ppparis/
+    - bin/
+    - lib/
+    - pyvenv.cfg
   artifacts:
     paths:
     - data/ppparis/
-- 
GitLab