-
Notifications
You must be signed in to change notification settings - Fork 39
106 lines (106 loc) · 3 KB
/
ci.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
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
name: build
on:
pull_request:
push:
branches:
- main
jobs:
build-linux:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17
id: go
- uses: azure/[email protected]
with:
version: 'v3.7.0'
id: install
- uses: azure/setup-kubectl@v3
id: install-kubectl
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
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-
id: cache
- name: Install command dependencies
run: |
mkdir -p $HOME/go/bin
export GOPATH=$HOME/go
echo "GOPATH=$GOPATH" >> $GITHUB_ENV
echo "GO_VERSION=$(go version | awk '{ print $3}' | sed 's/^go//')" >> $GITHUB_ENV
echo "$HOME/go/bin" >> $GITHUB_PATH
make install-ci install
- name: Build
run: make build
- name: Lint
run: make lint
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
version: v0.11.1
wait: 90s
cluster_name: kind
- name: Test
run: |
make test TEST_FLAGS="-timeout 3m -tags integration"
- uses: codecov/codecov-action@v2
- name: goreleaser
uses: goreleaser/goreleaser-action@v2
with:
args: release --snapshot --skip=publish --clean --release-notes .release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows:
name: Build(Windows)
runs-on: windows-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17
id: go
- uses: azure/[email protected]
with:
version: 'v3.7.0'
id: install
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
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-
id: cache
- name: Install command dependencies
run: |
echo "GOPATH=$HOME/go" >> $GITHUB_ENV
echo "GO_VERSION=$(go version | awk '{ print $3}' | sed 's/^go//')" >> $GITHUB_ENV
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Build
run: make build
- name: Test
run: make test