-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (41 loc) · 1.07 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
name: Lint and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Gitleaks
uses: zricethezav/[email protected]
lint:
runs-on: ubuntu-latest
container:
image: golangci/golangci-lint:v1.42.1
steps:
- uses: actions/checkout@v2
- name: Lint
run: golangci-lint run ./...
test:
runs-on: ubuntu-latest
container:
image: golang:1.23
steps:
- uses: actions/checkout@v2
- name: Set GOFLAGS to disable VCS
run: echo "GOFLAGS=-buildvcs=false" >> $GITHUB_ENV
- name: Enable Go modules
run: echo "GO111MODULE=on" >> $GITHUB_ENV
- name: Download dependencies
run: go mod download
- name: Run tests
run: |
go test -race $(go list ./... | grep -v /vendor/) -v -coverprofile=coverage.out
grep -v "mock.go" coverage.out > cover.out
- name: Generate coverage report
run: go tool cover -func=cover.out