forked from nautilus/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (75 loc) · 2.08 KB
/
run-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: CI Checks
# run this workflow on commits and pull requests
on:
push:
branches: [ master ]
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x # Avoid latest here. New Go versions can break linters.
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50.1
build:
name: Build release binaries
runs-on: ubuntu-latest
steps:
- name: Use latest Go version
uses: actions/setup-go@v3
with:
go-version: ^1.18
- name: Checkout source
uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Install runner and dependencies
run: |
if [[ "$(go version)" =~ go1\.([0-9]+) ]] && (( "${BASH_REMATCH[1]}" >= 16 )); then
go install github.com/alecaivazis/run@latest
else
go get github.com/alecaivazis/run
fi
- name: Build
run: |
run install:cd
run build
tests:
name: Test with Go ${{ matrix.go }}
runs-on: ubuntu-latest
strategy:
matrix:
go:
- 1.16.x
- 1.17.x
- ^1.18 # Latest version of Go
steps:
- name: Use Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Checkout source
uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Install runner and dependencies
run: |
if [[ "$(go version)" =~ go1\.([0-9]+) ]] && (( "${BASH_REMATCH[1]}" >= 16 )); then
go install github.com/alecaivazis/run@latest
else
go get github.com/alecaivazis/run
fi
- name: Run tests
run: |
run tests:coverage
- name: Report to Coveralls
if: matrix.go == '^1.18'
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out