-
-
Notifications
You must be signed in to change notification settings - Fork 398
201 lines (166 loc) · 5.5 KB
/
test.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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: test
on:
push:
pull_request:
jobs:
test-matrix:
strategy:
matrix:
operating-system: [ubuntu-20.04, windows-latest, macOS-latest]
runs-on: ${{ matrix.operating-system }}
steps:
- name: Disable EOL conversions
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.16"
- name: Install Go deps
# Since 10/23/2019 pwsh is the default shell
# on Windows, but pwsh fails to install protoc-gen-go so
# we force bash as default shell for all OSes in this task
run: |
go get github.com/golangci/govet
go get golang.org/x/lint/golint
go get github.com/golang/protobuf/protoc-gen-go
go get github.com/cmaglie/go.rice/rice
shell: bash
- name: Install Taskfile
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: "3.8"
architecture: "x64"
- name: Install Poetry
run: pip install poetry
- name: Install buf (protoc linter)
if: runner.os == 'Linux'
run: |
go install github.com/bufbuild/buf/cmd/buf@latest
go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@latest
go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@latest
shell: bash
- name: Check the code is good
if: runner.os == 'Linux'
run: task check
- name: Install protoc compiler
if: runner.os == 'Linux'
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check protocol buffers compile correctly
if: runner.os == 'Linux'
run: task protoc:compile
- name: Build the CLI
run: task build
- name: Run unit tests
run: task test-unit
- name: Run unit tests on the legacy package
# Run legacy tests on one platform only
if: matrix.operating-system == 'ubuntu-20.04'
run: task test-legacy
- name: Run integration tests
run: task test-integration
- name: Send unit tests coverage to Codecov
if: >
matrix.operating-system == 'ubuntu-20.04' &&
github.event_name == 'push'
uses: codecov/codecov-action@v1
with:
file: ./coverage_unit.txt
flags: unit
- name: Send legacy tests coverage to Codecov
if: >
matrix.operating-system == 'ubuntu-20.04' &&
github.event_name == 'push'
uses: codecov/codecov-action@v1
with:
file: ./coverage_legacy.txt
flags: unit
- name: Send integration tests coverage to Codecov
if: >
matrix.operating-system == 'ubuntu-20.04' &&
github.event_name == 'push'
uses: codecov/codecov-action@v1
with:
file: ./coverage_integ.txt
flags: integ
create-test-artifacts:
runs-on: ubuntu-20.04
needs: test-matrix
steps:
- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Install Taskfile
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Build
run: |
PACKAGE_NAME_PREFIX="${{ github.workflow }}"
if [ "${{ github.event_name }}" = "pull_request" ]; then
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
fi
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
export PACKAGE_NAME_PREFIX
task dist:all
# Uploads all architectures as separate artifacts
- name: Upload Linux 32 bit artifact
uses: actions/upload-artifact@v2
with:
name: Linux_32bit
path: dist/*Linux_32bit.tar.gz
- name: Upload Linux 64 bit artifact
uses: actions/upload-artifact@v2
with:
name: Linux_64bit
path: dist/*Linux_64bit.tar.gz
- name: Upload Windows 32 bit artifact
uses: actions/upload-artifact@v2
with:
name: Windows_32bit
path: dist/*Windows_32bit.zip
- name: Upload Windows 64 bit artifact
uses: actions/upload-artifact@v2
with:
name: Windows_64bit
path: dist/*Windows_64bit.zip
- name: Upload Linux ARMv6 artifact
uses: actions/upload-artifact@v2
with:
name: Linux_ARMv6
path: dist/*Linux_ARMv6.tar.gz
- name: Upload Linux ARMv7 artifact
uses: actions/upload-artifact@v2
with:
name: Linux_ARMv7
path: dist/*Linux_ARMv7.tar.gz
- name: Upload Linux ARM64 artifact
uses: actions/upload-artifact@v2
with:
name: Linux_ARM64
path: dist/*Linux_ARM64.tar.gz
- name: Upload Linux ARM64 bit artifact
uses: actions/upload-artifact@v2
with:
name: Linux_ARM64
path: dist/*Linux_ARM64.tar.gz
- name: Upload MacOS 64 bit artifact
uses: actions/upload-artifact@v2
with:
name: macOS_64bit
path: dist/*macOS_64bit.tar.gz
- name: Upload checksums
uses: actions/upload-artifact@v2
with:
name: checksums
path: dist/*checksums.txt