Skip to content

Commit 3dd2e20

Browse files
committed
Reconfigure GitHub workflow
1 parent 91e775a commit 3dd2e20

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/go.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Go
2+
on: [push, pull_request]
3+
jobs:
4+
5+
build:
6+
name: Build
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, macos-latest, windows-latest]
11+
12+
steps:
13+
14+
- name: Set up Go
15+
uses: actions/setup-go@v2
16+
with:
17+
stable: 'false'
18+
go-version: '1.18.0-beta1'
19+
20+
- name: Checkout
21+
uses: actions/checkout@v1
22+
with:
23+
fetch-depth: 1
24+
25+
- name: Cache Go modules
26+
uses: actions/cache@v1
27+
with:
28+
path: ~/go/pkg/mod
29+
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.OS }}-build-${{ env.cache-name }}-
32+
${{ runner.OS }}-build-
33+
${{ runner.OS }}-
34+
35+
# todo: enable when go 1.18 is supported
36+
# - name: Lint
37+
# uses: golangci/golangci-lint-action@v2
38+
# with:
39+
# version: v1.43.0
40+
# args: --timeout 10m
41+
42+
- name: Vet
43+
if: matrix.os == 'ubuntu-latest'
44+
run: go vet -v ./...
45+
46+
- name: Build
47+
env:
48+
CGO_ENABLED: 0
49+
run: go build -ldflags "-s -w" ./...
50+
51+
- name: Test
52+
run: go test -v -race ./...

0 commit comments

Comments
 (0)