From 3927b659651937c6b1a06dd5abaf0408d905b895 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Sat, 16 Dec 2017 16:10:48 +0100
Subject: [PATCH] Fixed broken Gitlab CI build and added pip cache

---
 .gitlab-ci.yml | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ea1fbf67c..d77d91f17 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,16 +13,22 @@ stages:
 test_api:
   stage: test
   image: funkwhale/funkwhale:base
+  variables:
+    PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
+    DATABASE_URL: "sqlite://"
   before_script:
+    - python3 -m venv --copies virtualenv
+    - source virtualenv/bin/activate
     - cd api
     - pip install -r requirements/base.txt
     - pip install -r requirements/local.txt
     - pip install -r requirements/test.txt
   script:
     - pytest
-  variables:
-    DATABASE_URL: "sqlite://"
-
+  cache:
+    key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
+    paths:
+      - "$CI_PROJECT_DIR/pip-cache"
   tags:
     - docker
 
-- 
GitLab