Skip to content

Commit f8634d7

Browse files
authored
Merge pull request #260 from SamYuan1990/memoryleakcheck
CI:impl for escapes detect as github action
2 parents 1c7023e + 34694d5 commit f8634d7

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.github/workflows/gogc.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: go escapes detect
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
escapes_detect:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@main
11+
- uses: actions/setup-go@main
12+
with:
13+
go-version: 1.18
14+
- name: run escapes detect
15+
run: make escapes_detect
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: go vulnerability detect
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
vulnerability_detect:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@main
11+
- uses: actions/setup-go@main
12+
with:
13+
go-version: 1.18
14+
- name: run vulnerability detect
15+
run: make govulncheck

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ test: ginkgo-set tidy-vendor
141141
test-verbose: ginkgo-set tidy-vendor
142142
@go test -tags $(GO_BUILD_TAGS) -covermode=atomic -coverprofile=coverage.out -v ./... --race --bench=. -cover --count=1 --vet=all
143143

144+
escapes_detect: tidy-vendor
145+
@go build -tags $(GO_BUILD_TAGS) -gcflags="-m -l" ./... | grep "escapes to heap" || true
146+
147+
set_govulncheck:
148+
@go install golang.org/x/vuln/cmd/govulncheck@latest
149+
150+
govulncheck: set_govulncheck tidy-vendor
151+
@govulncheck -v ./... || true
152+
144153
format:
145154
gofmt -e -d -s -l -w pkg/ cmd/
146155

0 commit comments

Comments
 (0)