-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (41 loc) · 1.08 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
name: Go
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.54.2
args: --timeout 10m
- name: Vet
if: matrix.os == 'ubuntu-latest'
run: go vet -v ./...
- name: Build
env:
CGO_ENABLED: 0
run: go build -ldflags "-s -w" ./...
- name: Test
run: go test -v -race ./...