From 8a5a3c2496ec06a26057779df43ceb341b2689bc Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Tue, 15 Oct 2019 15:59:18 -0400 Subject: [PATCH 1/4] fix ci issue with tags --- .circleci/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 27679d6c..0051221f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,16 @@ jobs: executor: golang steps: - checkout + - run: + name: Checkout with tags + command: | + git fetch --force origin "refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}" + if [ -n "$CIRCLE_BRANCH" ] + then + git reset --hard $CIRCLE_SHA1 + git checkout -q -B $CIRCLE_BRANCH + fi + git reset --hard $CIRCLE_SHA1 - restore_cache: name: "Restore go modules cache" keys: From 107431a311473be57cd5c1d334448188ae4c206b Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Tue, 15 Oct 2019 16:00:40 -0400 Subject: [PATCH 2/4] lint --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0051221f..2e72b807 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,15 +34,15 @@ jobs: steps: - checkout - run: - name: Checkout with tags - command: | - git fetch --force origin "refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}" - if [ -n "$CIRCLE_BRANCH" ] - then - git reset --hard $CIRCLE_SHA1 - git checkout -q -B $CIRCLE_BRANCH - fi - git reset --hard $CIRCLE_SHA1 + name: Checkout with tags + command: | + git fetch --force origin "refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}" + if [ -n "$CIRCLE_BRANCH" ] + then + git reset --hard $CIRCLE_SHA1 + git checkout -q -B $CIRCLE_BRANCH + fi + git reset --hard $CIRCLE_SHA1 - restore_cache: name: "Restore go modules cache" keys: From 0e389144ab6a39cdf66c7a57b7b12871d5267a8b Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Tue, 15 Oct 2019 16:06:12 -0400 Subject: [PATCH 3/4] fix ci config --- .circleci/config.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e72b807..6f796b38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,33 @@ commands: jobs: setup-dependencies: + executor: golang + steps: + - checkout + - restore_cache: + name: "Restore go modules cache" + keys: + - go-mod-v2-{{ checksum "go.sum" }} + - run: + name: Cache go modules + command: make go-mod-cache + - run: + name: Build + command: make build + - run: + name: Git garbage collection + command: git gc + - save_cache: + name: "Save go modules cache" + key: go-mod-v2-{{ checksum "go.sum" }} + paths: + - "/go/pkg/mod" + - save_cache: + name: "Save source code cache" + key: go-src-v1-{{ .Revision }} + paths: + - ".git" + setup-dependencies-tags: executor: golang steps: - checkout From 0247f15ae3521e0daf6e81fb6dafe805b876a134 Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Tue, 15 Oct 2019 16:08:21 -0400 Subject: [PATCH 4/4] fix ci config for tags --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f796b38..579b1f53 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -146,6 +146,14 @@ workflows: - test-cover: requires: - setup-dependencies + - setup-dependencies-tags: + # This filter enables the job for tags + filters: + branches: + ignore: /.*/ + tags: + only: + - /^v.*/ - test-all: requires: - setup-dependencies