-
Notifications
You must be signed in to change notification settings - Fork 176
82 lines (69 loc) · 1.57 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
name: Test
on:
push:
tags:
- v*
branches:
- master
- v*
- dev*
- ci*
- feat*
- fix*
- refactor*
- 'refactor/*'
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yml"
pull_request:
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yml"
types:
- opened
- reopened
- synchronize
env:
DEFAULT_MAVEN_REPO: https://repo1.maven.org/maven2/
jobs:
test:
runs-on: ubuntu-latest
env:
CGO_ENABLED: '0'
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Download dependencies
run: go mod download
- name: Install Go tools
run: |
cd /tmp
go install golang.org/x/tools/cmd/[email protected]
- name: Go mod tidy
run: go mod tidy
- name: Regenerate code
run: go generate -v ./...
- name: Reformat code
run: go fmt ./...
- name: Check difference
run: git diff --color --exit-code .
- name: Go vet
run: go vet -v .
- name: Install gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run tests
run: |
set -euo pipefail
go generate ./...
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt