forked from redpanda-data/connect
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (94 loc) · 2.8 KB
/
test.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Test
on:
push:
pull_request:
schedule:
- cron: '0 0/2 * * *' # Every two hours
jobs:
cross-build:
if: ${{ github.repository == 'benthosdev/benthos' || github.event_name != 'schedule' }}
strategy:
fail-fast: false
matrix:
go-version: [1.19.x, 1.20.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
CGO_ENABLED: 0
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: build --snapshot --timeout 60m
test:
if: ${{ github.repository == 'benthosdev/benthos' || github.event_name != 'schedule' }}
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
check-latest: true
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Deps
run: make deps && git diff-index --quiet HEAD || { >&2 echo "Stale go.{mod,sum} detected. This can be fixed with 'make deps'."; exit 1; }
- name: Docs
run: make docs && git diff-index --quiet HEAD || { >&2 echo "Stale docs detected. This can be fixed with 'make docs'."; exit 1; }
- name: Test
run: make test
golangci-lint:
if: ${{ github.repository == 'benthosdev/benthos' || github.event_name != 'schedule' }}
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
check-latest: true
- name: Checkout code
uses: actions/checkout@v3
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 30m cmd/... internal/... public/...
# TODO: Remove this after https://github.com/golangci/golangci-lint/issues/3094 is addressed
# - name: Get govulncheck
# run: go install golang.org/x/vuln/cmd/govulncheck@latest
# - name: Run govulncheck
# run: govulncheck ./...