Browse Source

Coverage: cache Go modules

loyalsoldier 5 years ago
parent
commit
69da2f8526
1 changed files with 11 additions and 1 deletions
  1. 11 1
      .github/workflows/coverage.yml

+ 11 - 1
.github/workflows/coverage.yml

@@ -15,10 +15,20 @@ jobs:
         with:
         with:
           go-version: ^1.14
           go-version: ^1.14
 
 
-      - name: Checkout default branch
+      - name: Checkout codebase
         uses: actions/checkout@v2
         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
       - name: Get dependencies
+        if: steps.cache-gomodules.outputs.cache-hit != 'true'
         run: |
         run: |
           go get -v -t -d ./...
           go get -v -t -d ./...