From a7d7f9d96c84ef8fe85e9bae21665f240cb38507 Mon Sep 17 00:00:00 2001 From: Mike Bishop Date: Fri, 6 Sep 2019 11:25:36 -0400 Subject: [PATCH 1/4] Cache git repo between Circle runs --- .circleci/config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index bea3554063..a0f0736c54 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,13 @@ jobs: working_directory: ~/draft steps: + - restore_cache: + name: "Restoring cache - Git" + keys: + - v1-cache-git-{{ .Branch }}-{{ .Revision }} + - v1-cache-git-{{ .Branch }} + - v1-cache-git- + - checkout # Build txt and html versions of drafts @@ -42,6 +49,15 @@ jobs: - store_artifacts: path: /tmp/artifacts + - run: + name: "Prepare for Caching" + command: "git gc" + + - save_cache: + name: "Saving Cache - Git" + key: v1-cache-git-{{ .Branch }}-{{ .Revision }} + paths: + - ~/draft workflows: version: 2 From b8e45fba31c52c5a9bd9dda9b26e8b9443fa4fb5 Mon Sep 17 00:00:00 2001 From: Mike Bishop Date: Fri, 6 Sep 2019 11:40:49 -0400 Subject: [PATCH 2/4] Cache draft references too --- .circleci/config.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a0f0736c54..09deabb77b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,12 @@ jobs: - v1-cache-git-{{ .Branch }} - v1-cache-git- + - restore_cache: + name: "Restoring cache - References" + keys: + - v1-cache-references-{{ epoch }} + - v1-cache-references- + - checkout # Build txt and html versions of drafts @@ -59,6 +65,12 @@ jobs: paths: - ~/draft + - save_cache: + name: "Saving Cache - Drafts" + key: v1-cache-references-{{ epoch }} + paths: + - ~/.cache/xml2rfc + workflows: version: 2 build: From c642ae92f3b78642e666d76701a1606d87446e8d Mon Sep 17 00:00:00 2001 From: Mike Bishop Date: Fri, 6 Sep 2019 11:57:23 -0400 Subject: [PATCH 3/4] Only gc if called for --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 09deabb77b..7f986908d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ jobs: - run: name: "Prepare for Caching" - command: "git gc" + command: "git gc --auto" - save_cache: name: "Saving Cache - Git" From 56e9e1a6515ac1ea6e882a83c48d7149070bdd17 Mon Sep 17 00:00:00 2001 From: Mike Bishop Date: Mon, 9 Sep 2019 11:34:45 -0400 Subject: [PATCH 4/4] Add master to fallback path for new branches Newly-created branches are most likely to have been based on master; if no cache exists for a repo, take master as the starting point --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f986908d7..d1430b7df6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,7 @@ jobs: keys: - v1-cache-git-{{ .Branch }}-{{ .Revision }} - v1-cache-git-{{ .Branch }} + - v1-cache-git-master - v1-cache-git- - restore_cache: