|
|
@@ -41,26 +41,13 @@ jobs:
|
|
|
|
|
|
- name: Setup Go
|
|
|
uses: actions/setup-go@v4
|
|
|
+ id: setup-go
|
|
|
with:
|
|
|
go-version-file: "go.mod"
|
|
|
|
|
|
- - name: Find the Go Cache
|
|
|
- id: go
|
|
|
- run: |
|
|
|
- echo "::set-output name=build-cache::$(go env GOCACHE)"
|
|
|
- echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
|
|
|
-
|
|
|
- - name: Cache the Go Build Cache
|
|
|
- uses: actions/cache@v3
|
|
|
- with:
|
|
|
- path: ${{ steps.go.outputs.build-cache }}
|
|
|
- key: ${{ runner.os }}-build-${{ github.sha }}-${{ hashFiles('**/go.sum') }}
|
|
|
-
|
|
|
- - name: Cache Go Dependencies
|
|
|
- uses: actions/cache@v3
|
|
|
- with:
|
|
|
- path: ${{ steps.go.outputs.mod-cache }}
|
|
|
- key: ${{ runner.os }}-mod-${{ github.sha }}-${{ hashFiles('**/go.sum') }}
|
|
|
+ - name: Download Go modules
|
|
|
+ if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
|
|
|
+ run: go mod download
|
|
|
|
|
|
- name: Lint
|
|
|
uses: golangci/golangci-lint-action@v3
|
|
|
@@ -78,33 +65,20 @@ jobs:
|
|
|
- name: Checkout
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
- - name: Configure Git
|
|
|
- run: |
|
|
|
- git config user.name "$GITHUB_ACTOR"
|
|
|
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
|
-
|
|
|
- name: Setup Go
|
|
|
uses: actions/setup-go@v4
|
|
|
+ id: setup-go
|
|
|
with:
|
|
|
go-version-file: "go.mod"
|
|
|
|
|
|
- - name: Find the Go Cache
|
|
|
- id: go
|
|
|
- run: |
|
|
|
- echo "::set-output name=build-cache::$(go env GOCACHE)"
|
|
|
- echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
|
|
|
+ - name: Download Go modules
|
|
|
+ if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
|
|
|
+ run: go mod download
|
|
|
|
|
|
- - name: Cache the Go Build Cache
|
|
|
- uses: actions/cache@v3
|
|
|
- with:
|
|
|
- path: ${{ steps.go.outputs.build-cache }}
|
|
|
- key: ${{ runner.os }}-build-${{ github.sha }}-${{ hashFiles('**/go.sum') }}
|
|
|
-
|
|
|
- - name: Cache Go Dependencies
|
|
|
- uses: actions/cache@v3
|
|
|
- with:
|
|
|
- path: ${{ steps.go.outputs.mod-cache }}
|
|
|
- key: ${{ runner.os }}-mod-${{ github.sha }}-${{ hashFiles('**/go.sum') }}
|
|
|
+ - name: Configure Git
|
|
|
+ run: |
|
|
|
+ git config user.name "$GITHUB_ACTOR"
|
|
|
+ git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
|
|
|
|
- name: Check Diff
|
|
|
run: |
|
|
|
@@ -124,26 +98,13 @@ jobs:
|
|
|
|
|
|
- name: Setup Go
|
|
|
uses: actions/setup-go@v4
|
|
|
+ id: setup-go
|
|
|
with:
|
|
|
go-version-file: "go.mod"
|
|
|
|
|
|
- - name: Find the Go Cache
|
|
|
- id: go
|
|
|
- run: |
|
|
|
- echo "::set-output name=build-cache::$(go env GOCACHE)"
|
|
|
- echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
|
|
|
-
|
|
|
- - name: Cache the Go Build Cache
|
|
|
- uses: actions/cache@v3
|
|
|
- with:
|
|
|
- path: ${{ steps.go.outputs.build-cache }}
|
|
|
- key: ${{ runner.os }}-build-${{ github.sha }}-${{ hashFiles('**/go.sum') }}
|
|
|
-
|
|
|
- - name: Cache Go Dependencies
|
|
|
- uses: actions/cache@v3
|
|
|
- with:
|
|
|
- path: ${{ steps.go.outputs.mod-cache }}
|
|
|
- key: ${{ runner.os }}-mod-${{ github.sha }}-${{ hashFiles('**/go.sum') }}
|
|
|
+ - name: Download Go modules
|
|
|
+ if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
|
|
|
+ run: go mod download
|
|
|
|
|
|
- name: Cache envtest binaries
|
|
|
uses: actions/cache@v3
|