Skip to content
Closed
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
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'vulns/**'
- 'LICENSE'
pull_request:
paths-ignore:
- '**.md'
- 'vulns/**'
- 'LICENSE'
env:
GO_VERSION: '1.22'
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Checkout code into the Go module directory
uses: actions/checkout@v4

- name: Tidy
run: |
go mod tidy
if [ -n "$(git status --porcelain)" ]; then
echo "Run 'go mod tidy' and push it"
exit 1
fi

- name: Fmt
run: |
go fmt ./...
if [ -n "$(git status --porcelain)" ]; then
echo "Run 'go fmt ./...' and push it"
exit 1
fi

- name: Lint
uses: golangci/[email protected]
with:
version: v1.59
args: --verbose

- name: Test
run: |
go test -v ./...