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

Tweak CI #326

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Build and test
permissions:
contents: write
jobs:
go_generate:
generated:
name: Check generated code is up to date
runs-on: ubuntu-22.04
steps:
Expand All @@ -13,13 +13,14 @@ jobs:
uses: WillAbides/[email protected]
with:
go-version-file: go.mod
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code
- name: go generate
env:
GO111MODULE: 'on'
GOPATH: ${{ github.workspace }}/go
run: go generate -x
- name: Diff after go generate
run: git diff --exit-code
run: |
go generate -x
git diff --exit-code
build_and_test:
name: Build and test
runs-on: ubuntu-22.04
Expand All @@ -32,23 +33,31 @@ jobs:
with:
go-version-file: go.mod
- name: go version
env:
GO111MODULE: 'on'
run: go version
- name: go mod verify
run: go mod verify
- name: go vet
run: go vet ./...
- name: go fmt ./..
run: |
go fmt ./...
git diff --exit-code
- name: Test
uses: robherley/[email protected]
with:
testArguments: -race -cover -covermode=atomic -coverprofile=coverage.txt ./...
testArguments: -race -shuffle=on -benchtime=1x -cover -covermode=atomic -coverprofile=coverage.txt ./...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Install changelog management tool
run: go install github.com/goreleaser/chglog/cmd/chglog@main
- name: Build changelog
run: chglog init
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
version: v2
args: release --snapshot
- uses: actions/upload-artifact@v4
with:
Expand Down