Skip to content

Syncing searches divergent branches #208

Syncing searches divergent branches

Syncing searches divergent branches #208

Workflow file for this run

# This workflow will build, vet, and format a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
pull_request:
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.5'
- name: Check Go code format
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Go code is not formatted. Run 'go fmt' to format your code."
exit 1
fi
- name: Check go.mod format
run: |
if [ -n "$(go mod tidy)" ]; then
echo "Go module is not tidied. Run 'go mod tiny' to clean up old deps."
exit 1
fi
vet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.5'
- name: Vet Go code
run: go vet ./...
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.5'
- name: Build
run: go build -v ./...
test:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.5'
- name: Test
run: go test ./...