From 69da2f85262504862536ec40697446bfbff35055 Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sun, 30 Aug 2020 23:55:00 +0800 Subject: [PATCH] Coverage: cache Go modules --- .github/workflows/coverage.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 252fce8a..b63d65b6 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,10 +15,20 @@ jobs: with: go-version: ^1.14 - - name: Checkout default branch + - name: Checkout codebase uses: actions/checkout@v2 + - name: Cache go module + uses: actions/cache@v2 + id: cache-gomodules + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Get dependencies + if: steps.cache-gomodules.outputs.cache-hit != 'true' run: | go get -v -t -d ./...