From 02e3dc5267157745a96baa5d7a59d9b9475d8505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Bence?= Date: Fri, 8 May 2020 19:25:42 +0200 Subject: [PATCH 1/2] add cache to ci --- .drone.yml | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index d5ba8fb..e22b387 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,11 +3,25 @@ type: docker name: default steps: +- name: restore-cache-with-filesystem + image: meltwater/drone-cache + settings: + backend: "filesystem" + restore: true + cache_key: "{{ .Repo.Name }}" + archive_format: "gzip" + filesystem_cache_root: "/tmp/cache" + mount: + - '.pipcache' + volumes: + - name: cache + path: /tmp/cache + - name: static_analysis image: python:3.8 commands: - - pip3 install pylint bandit mccabe - - pip3 install -r requirements.txt + - pip3 install --cache-dir='./.pipcache' pylint bandit mccabe + - pip3 install --cache-dir='./.pipcache' -r requirements.txt - find . -name "*.py" -exec python3 -m py_compile '{}' \; - find . -name "*.py" -exec pylint '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi - find . -name "*.py" -exec python3 -m mccabe --min 3 '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi @@ -42,6 +56,23 @@ steps: - cd docs - make html +- name: rebuild-cache-with-filesystem + image: meltwater/drone-cache + pull: true + settings: + backend: "filesystem" + rebuild: true + cache_key: "{{ .Repo.Name }}" + archive_format: "gzip" + filesystem_cache_root: "/tmp/cache" + mount: + - '.pipcache' + volumes: + - name: cache + path: /tmp/cache + + + - name: build_docs image: docker:stable-dind volumes: From 3d4274db8689a2710b0233c9809c8eea405e5293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Bence?= Date: Fri, 8 May 2020 19:32:13 +0200 Subject: [PATCH 2/2] add cache volume --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index e22b387..e3bcdf3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -71,8 +71,6 @@ steps: - name: cache path: /tmp/cache - - - name: build_docs image: docker:stable-dind volumes: @@ -114,3 +112,5 @@ services: volumes: - name: dockersock temp: {} +- name: cache + temp: {}