-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (62 loc) · 1.7 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
name: "Test & check build"
on: [push, pull_request]
jobs:
fmt-go:
name: Check format Go
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: ^1.18
- uses: actions/checkout@v3
- name: Install Gofumpt
run: go install mvdan.cc/gofumpt@latest
- name: Check fmt using Gofumpt
run: |
files=$(~/go/bin/gofumpt -l -d .);
if [[ -n "$files" ]]; then
printf '%s\nGofumpt would make changes, install Gofumpt and run "make lint"' "$files";
exit 1;
fi
shell: bash
lint-go:
name: Lint Go
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: ^1.18
- uses: actions/checkout@v3
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
# See https://github.com/golangci/golangci-lint-action/issues/485 for why we do --out-....
with:
version: latest
args: "-E stylecheck,revive,gocritic --out-${NO_FUTURE}format colored-line-number --timeout 5m"
build-cli:
name: Build CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.18
- run: make build-cli
build-gui:
name: Build GUI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.18
- run: make build-gui
test-go:
name: Test Go
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.18
- run: make test