summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-04-17 13:54:35 -0400
committerGitHub <noreply@github.com>2020-04-17 11:54:35 -0600
commit6963a72a63bf2905e85be170d54371da4b3c5b8b (patch)
tree40efa0fe571b7e0ec4513d64a88086d79b3590d6 /.github
parent76bbb473a57f60a9c7f62afc61a93d10a8720ab5 (diff)
ci: Cache the GOCACHE directory to speed up builds and tests (#3273)
* ci: Let's see if caching GOCACHE helps... * ci: Use GOCACHE env instead (fixes windows), remove build -a * ci: Hack to pull the GOCACHE env up to CI vars * ci: Change cache key (mainly to wipe cache now)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml11
1 files changed, 10 insertions, 1 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4bd29da..6f34dde 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -66,6 +66,15 @@ jobs:
env
# Calculate the short SHA1 hash of the git commit
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
+ echo "::set-output name=go_cache::$(go env GOCACHE)"
+
+ - name: Cache the build cache
+ uses: actions/cache@v1
+ with:
+ path: ${{ steps.vars.outputs.go_cache }}
+ key: ${{ runner.os }}-go-gocache-${{ hashFiles('**/go.sum') }}
+ restore-keys: |
+ ${{ runner.os }}-go-
- name: Get dependencies
run: |
@@ -77,7 +86,7 @@ jobs:
env:
CGO_ENABLED: 0
run: |
- go build -trimpath -a -ldflags="-w -s" -v
+ go build -trimpath -ldflags="-w -s" -v
- name: Publish Build Artifact
uses: actions/upload-artifact@v1