35 lines
617 B
YAML
35 lines
617 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- main
|
|
|
|
jobs:
|
|
lint-test:
|
|
name: Lint and 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: Check formatting
|
|
run: |
|
|
files="$(gofmt -l .)"
|
|
if [ -n "$files" ]; then
|
|
echo "The following files need gofmt:"
|
|
echo "$files"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Test
|
|
run: go test ./...
|