-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (76 loc) · 2.04 KB
/
go.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
name: go
on:
push:
branches:
- master
pull_request:
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: go.sum
- name: Generate code
run: go generate ./...
working-directory: go
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
install-mode: goinstall
version: latest
working-directory: go
args: --config="${GITHUB_WORKSPACE}/go/.golangci.yaml"
test:
name: test
runs-on: ubuntu-latest
defaults:
run:
working-directory: go
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: go.sum
- name: Install dependencies
run: go mod tidy
- name: Generate code
run: go generate ./...
- name: Compile
run: go build -v ./...
- name: Run tests
run: go test -v ./...
benchmark:
name: benchmark
runs-on: ubuntu-latest
defaults:
run:
working-directory: go
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: go.sum
- name: Generate code
run: go generate ./...
- name: Run benchmark
run: go test ./cmd/glox -bench=. -count 5 -run=^# -timeout 30m | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: go/output.txt
external-data-json-path: ./cache/benchmark-data.json
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true