Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Improve Go workflows #1485

Merged
merged 1 commit into from Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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