From 4313473f6f42a99a70cc8abeba7bc3084d2fd0dc Mon Sep 17 00:00:00 2001 From: Cam Saul Date: Fri, 13 Jan 2023 07:59:35 +0000 Subject: [PATCH] Improved cache keys --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/tests.yml | 25 ++++++++++--------------- toucan1/build.clj | 3 ++- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 357cf33..dbfe660 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,9 +29,9 @@ jobs: ~/.m2/repository ~/.gitlibs ~/.deps.clj - key: v1-deploy-${{ hashFiles('./deps.edn') }} + key: v1-${{ hashFiles('./deps.edn') }}-deploy restore-keys: | - v1-deploy- + v1-${{ hashFiles('./deps.edn') }}- v1- - name: Build Toucan 2 run: clojure -T:build build diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4986f01..aafa260 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,10 +47,9 @@ jobs: ~/.m2/repository ~/.gitlibs ~/.deps.clj - key: v1-tests-postgres-${{ hashFiles('./deps.edn') }} + key: v1-${{ hashFiles('./deps.edn') }}-postgres restore-keys: | - v1-tests-postgres- - v1-tests- + v1-${{ hashFiles('./deps.edn') }}- v1- - run: clojure -X:dev:test:test-postgres name: Run tests @@ -78,10 +77,9 @@ jobs: ~/.m2/repository ~/.gitlibs ~/.deps.clj - key: v1-tests-h2-${{ hashFiles('./deps.edn') }} + key: v1-${{ hashFiles('./deps.edn') }}-h2 restore-keys: | - v1-tests-h2- - v1-tests- + v1-${{ hashFiles('./deps.edn') }}- v1- - run: clojure -X:dev:test:test-h2 name: Run tests @@ -108,10 +106,9 @@ jobs: ~/.m2/repository ~/.gitlibs ~/.deps.clj - key: v1-tests-whitespace-linter-${{ hashFiles('./deps.edn') }} + key: v1-${{ hashFiles('./deps.edn') }}-whitespace-linter restore-keys: | - v1-tests-whitespace-linter- - v1-tests- + v1-${{ hashFiles('./deps.edn') }}- v1- - run: clojure -T:whitespace-linter name: Run whitespace linter @@ -136,10 +133,9 @@ jobs: ~/.m2/repository ~/.gitlibs ~/.deps.clj - key: v1-tests-check-${{ hashFiles('./deps.edn') }} + key: v1-${{ hashFiles('./deps.edn') }}-check restore-keys: | - v1-tests-check- - v1-tests- + v1-${{ hashFiles('./deps.edn') }}- v1- - run: clojure -M:check name: Check Toucan 2 core namespaces @@ -167,10 +163,9 @@ jobs: ~/.m2/repository ~/.gitlibs ~/.deps.clj - key: v1-tests-codecov-${{ hashFiles('./deps.edn') }} + key: v1-${{ hashFiles('./deps.edn') }}-codecov restore-keys: | - v1-tests-codecov- - v1-tests- + v1-${{ hashFiles('./deps.edn') }}- v1- - run: clojure -X:dev:test-h2:cloverage name: Run tests with Cloverage diff --git a/toucan1/build.clj b/toucan1/build.clj index 68ab286..b137f96 100644 --- a/toucan1/build.clj +++ b/toucan1/build.clj @@ -1,5 +1,6 @@ (ns build - (:require [clojure.string :as str] + (:require [clojure.java.shell :as sh] + [clojure.string :as str] [org.corfield.build :as bb])) (def lib 'io.github.camsaul/toucan2-toucan1)