-
Notifications
You must be signed in to change notification settings - Fork 40
65 lines (53 loc) · 1.49 KB
/
tests.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build and tests
on:
# run tests on push to main, but not when other branches are pushed to
push:
branches:
- main
# run tests for all pull requests
pull_request:
jobs:
build:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
runs-on: ubuntu-latest
name: Go ${{ matrix.go-version }}
env:
GOPROXY: https://proxy.golang.org
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code
uses: actions/checkout@v3
- name: Build
run: |
GOOS=linux go build -o monsoon_linux
GOOS=windows go build -o monsoon_linux
GOOS=darwin go build -o monsoon_linux
- name: Run tests
run: |
export PATH=$HOME/bin:$PATH
go test ./...
lint:
name: Check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.51
args: --verbose --timeout 5m
- name: Check go.mod/go.sum
run: |
echo "check if go.mod and go.sum are up to date"
go mod tidy
git diff --exit-code go.mod go.sum