Skip to content

Test

Test #63

Workflow file for this run

name: Test
on:
workflow_call:
push:
branches:
- main
pull_request:
branches:
- main
create:
tags:
- "v*.*.*"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Install dependencies
run: go mod download
- name: Run go fmt
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not formatted:"
echo "$unformatted"
exit 1
fi
- name: Run go vet
run: go vet ./...
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: Run tests with coverage
run: go test -v -cover ./...