Skip to content

Add CI workflow for Go tests #1

Add CI workflow for Go tests

Add CI workflow for Go tests #1

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Verify dependencies
run: go mod verify
- name: Check formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "These files need gofmt:"
echo "$unformatted"
exit 1
fi
- name: Vet
run: go vet ./...
- name: Build
run: go build ./...
- name: Test (race + coverage)
run: go test -race -timeout 120s -coverprofile=coverage.out ./...