Skip to content

build badge

build badge #8

Workflow file for this run

name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Run go mod tidy
run: |
set -e
go mod tidy
output=$(git status -s)
if [ -z "${output}" ]; then
exit 0
fi
echo 'Please run `go mod tidy` on your branch, commit and push again.'
echo "$output"
exit 1
- name: Test
run: go test -v ./...
- name: Lint
run: go run golang.org/x/lint/golint -set_exit_status $(go list ./...)
- name: Build
run: go build -v ./...