From 350761e7f723a6eb9b78865bc22968130274e82f Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 27 Jul 2021 07:45:36 +0200 Subject: [PATCH 1/2] Remove .stack-work from cache --- .circleci/config.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca06ff83f0..ec7a0aa113 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,9 +18,9 @@ defaults: &defaults - restore_cache: keys: - - v2-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} - - v2-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }} - - v2-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }} + - v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} + - v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }} + - v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }} - run: name: Stack upgrade @@ -46,11 +46,9 @@ defaults: &defaults destination: bin - save_cache: - key: v2-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }} + key: v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }} paths: &cache_paths - ~/.stack - - ~/build/.stack-work - - ~/build/ghcide/.stack-work - run: name: Build including tests @@ -58,7 +56,7 @@ defaults: &defaults no_output_timeout: 120m - save_cache: - key: v2-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} + key: v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} paths: *cache_paths version: 2 From d8c1588bb4c9ca9d5d29d7c41daae05b7060c2be Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 27 Jul 2021 07:48:12 +0200 Subject: [PATCH 2/2] Deps cache only depends on resolver --- .circleci/config.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec7a0aa113..6431b8af07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,14 +12,8 @@ defaults: &defaults name: Figure out resolver for better caching command: grep '^resolver:' stack-build.txt > resolver.txt - - run: - name: Create a composite cabal file for changes detection - command: find . -name "*.cabal" | grep -v -e "stack-work" -e "dist-newstyle" -e "submodules" -e "testdata" | sort | xargs cat > all-cabal.txt - - restore_cache: keys: - - v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} - - v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }} - v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }} - run: @@ -55,10 +49,6 @@ defaults: &defaults command: stack --stack-yaml=${STACK_FILE} test --no-run-tests --no-terminal no_output_timeout: 120m - - save_cache: - key: v3-stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} - paths: *cache_paths - version: 2 jobs: ghc-8.6.4: