forked from openservicemesh/osm-health
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (125 loc) · 3.34 KB
/
main.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Go
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "**.md"
- "scripts/cleanup/**"
pull_request:
branches:
- main
paths-ignore:
- "docs/**"
- "scripts/cleanup/**"
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: ShellCheck
run: shellcheck -x $(find . -name '*.sh')
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Go 1.16
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.30
skip-pkg-cache: true
args: --timeout 5m --skip-dirs pkg/gen --skip-files "zz_generated.deepcopy.go$"
build:
name: Go build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Restore Module Cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gomod2-
- name: Restore Build Cache
uses: actions/cache@v2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: Go Build
run: make build-ci
unittest:
name: UnitTests
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Restore Module Cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gomod2-
- name: Restore Build Cache
uses: actions/cache@v2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: Test
run: make go-test-coverage
- name: Upload Coverage
if: ${{ success() }}
run: bash <(curl -s https://codecov.io/bash) -F unittests
simulation:
name: Simulations
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Restore Module Cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gomod2-
- name: Restore Build Cache
uses: actions/cache@v2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: Test
run: make go-test-coverage
- name: Upload Coverage
if: ${{ success() }}
run: bash <(curl -s https://codecov.io/bash) -F unittests
- name: Simulations
run: |
make kind-up
make
./tests/run.sh