Skip to content

Go

Go #214

Workflow file for this run

name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
linux:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Format
run: |
out=$(gofmt -d $(go list -f {{.Dir}} ./...))
if [[ -n $out ]]; then
echo "Go code is not formatted:"
gofmt -d $(go list -f {{.Dir}} ./...)
exit 1
fi
- name: Vet
run: go vet ./...
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -race ./...
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Vet
run: go vet ./...
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...