diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 562cebebd..7bf3e3f2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,33 @@ jobs: with: go-version: 1.18 + - name: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" + + - name: Cache Go build + uses: actions/cache@v3 + id: mybuild + with: + path: ~/.cache/go-build + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} + + - name: Cache Go Mod + uses: actions/cache@v3 + id: cache + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + - name: Run go mod download + if: steps.cache.outputs.cache-hit != 'true' run: go mod download + - name: Go build + if: steps.mybuild.outputs.cache-hit != 'true' + run: go build ./... + - name: Get go-licenses run: go install github.com/google/go-licenses@latest