From e692e3866bf2cbe240b64f96e03d590539e67aef Mon Sep 17 00:00:00 2001
From: Denton Gentry <dgentry@tailscale.com>
Date: Thu, 7 Jan 2021 20:42:05 -0800
Subject: [PATCH] Cache go modules.

Apply Go actions cache, as described in
https://markphelps.me/2019/11/speed-up-your-go-builds-with-actions-cache/

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
---
 .github/workflows/coverage.yml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 6b5934f1f..94ae6d273 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -25,6 +25,14 @@ jobs:
     - name: Check out code into the Go module directory
       uses: actions/checkout@v1
 
+      # https://markphelps.me/2019/11/speed-up-your-go-builds-with-actions-cache/
+    - name: Restore Cache
+      uses: actions/cache@preview
+      id: cache
+      with:
+        path: ~/go/pkg/mod
+        key: ${{ runner.os }}-${{ hashFiles('**/go.sum') }}
+
     - name: Basic build
       run: go build ./cmd/...