From 093ddc16e39959a59510a242f1c1408c764938e4 Mon Sep 17 00:00:00 2001 From: JP Flouret Date: Wed, 27 Mar 2024 16:41:24 -0700 Subject: [PATCH] Updated gitlab-ci cache settings --- .gitlab-ci.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71edd08..9b0d286 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,10 +3,13 @@ image: python:latest variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" -cache: - paths: - - .cache/pip - - venv/ +default: + cache: &global_cache + key: $CI_COMMIT_REF_SLUG + policy: pull-push + paths: + - .cache/pip + - venv/ before_script: - python -V @@ -30,6 +33,9 @@ build: - dist/*.whl test: + cache: + <<: *global_cache + policy: pull stage: test needs: [] script: @@ -39,11 +45,13 @@ test: - black --diff --check iqtrade tests examples publish: + cache: + <<: *global_cache + policy: pull stage: publish only: - tags needs: ["build"] script: - - pip install twine - python -m twine upload dist/* when: manual