-
Notifications
You must be signed in to change notification settings - Fork 309
39 lines (31 loc) · 844 Bytes
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: setup
uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: build
run: go build -v ./...
- name: test
run: go test -v ./...
- name: gofmt
if: matrix.os == 'ubuntu-latest'
run: exit $(gofmt -l . | wc -l)
- name: vet
if: matrix.os == 'ubuntu-latest'
run: go vet -all=true -v=true .