-
Notifications
You must be signed in to change notification settings - Fork 42
44 lines (37 loc) · 912 Bytes
/
build.yaml
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
name: Lint and Build
on:
push:
## do not lint and build when tagged, we already do that in push to master
tags-ignore:
- '*'
branches:
- '*'
pull_request:
branches: ['main', 'master']
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
go_version: "1.21"
golangci_lint_flags: "--timeout=5m0s"
build:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21.x'
- name: Install dependencies
run: go get ./...
- name: Test
run: go test -v ./... --race
- name: Build
run: go build -v ./...