Skip to content

Commit

Permalink
Improve Go workflows (#1485)
Browse files Browse the repository at this point in the history
  • Loading branch information
wata727 committed Aug 17, 2022
1 parent b291d96 commit 6d29af0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 45 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/build.yml
Expand Up @@ -25,20 +25,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- id: cache-paths
name: Get cache paths
run: |
echo "::set-output name=go-cache::$(go env GOCACHE)"
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"
- uses: actions/cache@v3
with:
path: |
${{ steps.cache-paths.outputs.go-cache }}
${{ steps.cache-paths.outputs.go-mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version-file: 'go.mod'
cache: true
- name: Run test
run: make test
- name: Run build
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/e2e.yml
Expand Up @@ -25,19 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- id: cache-paths
name: Get cache paths
run: |
echo "::set-output name=go-cache::$(go env GOCACHE)"
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"
- uses: actions/cache@v3
with:
path: |
${{ steps.cache-paths.outputs.go-cache }}
${{ steps.cache-paths.outputs.go-mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version-file: 'go.mod'
cache: true
- name: Run e2e
run: make e2e
16 changes: 2 additions & 14 deletions .github/workflows/generate.yml
Expand Up @@ -13,20 +13,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- id: cache-paths
name: Get cache paths
run: |
echo "::set-output name=go-cache::$(go env GOCACHE)"
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"
- uses: actions/cache@v3
with:
path: |
${{ steps.cache-paths.outputs.go-cache }}
${{ steps.cache-paths.outputs.go-mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version-file: 'go.mod'
cache: true
- run: go generate ./...
- run: git add --intent-to-add .
- run: git diff --exit-code
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version-file: 'go.mod'
- name: goreleaser check
uses: goreleaser/goreleaser-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version-file: 'go.mod'
- name: Run linters
uses: golangci/golangci-lint-action@v3.2.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version-file: 'go.mod'
- name: Install Cosign
uses: sigstore/cosign-installer@v2.5.0
with:
Expand Down

0 comments on commit 6d29af0

Please sign in to comment.