Merge pull request #355 from arnested/dependabot/github_actions/secur… #943
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
on: push | |
name: Build and test | |
permissions: | |
contents: write | |
jobs: | |
generated: | |
name: Check generated code is up to date | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
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 | |
run: | | |
go generate -x | |
git diff --exit-code | |
build_and_test: | |
name: Build and test | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: WillAbides/[email protected] | |
with: | |
go-version-file: go.mod | |
- name: go version | |
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 -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: "~> v2" | |
args: release --snapshot | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Debian packages | |
path: dist/*.deb | |
nilaway: | |
name: Nilaway | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: WillAbides/[email protected] | |
with: | |
go-version-file: go.mod | |
- name: Install nilaway | |
run: go install go.uber.org/nilaway/cmd/nilaway@latest | |
- name: Run nilaway | |
run: nilaway ./... | |
license_check: | |
name: License check | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: WillAbides/[email protected] | |
with: | |
go-version-file: go.mod | |
- name: Install wwhrd | |
run: go install github.com/frapposelli/wwhrd@latest | |
- name: go mod vendor | |
env: | |
GO111MODULE: 'on' | |
run: go mod vendor | |
- name: wwhrd check | |
run: wwhrd check |