-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (59 loc) · 1.72 KB
/
pr_checks.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
name: Checks
on:
pull_request:
env:
GOPRIVATE: github.com/teamwork/*
GOFLAGS: -mod=readonly
LANG: en_US.UTF-8
jobs:
lint:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.21"
- name: Setup git
run: git config --global url."https://[email protected]/".insteadOf "https://github.com/"
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
only-new-issues: true
args: "--out-${NO_FUTURE}format colored-line-number"
test:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.21"
- name: Setup git
run: git config --global url."https://[email protected]/".insteadOf "https://github.com/"
- name: Test
run: |
go mod tidy
go test -coverprofile=full.coverage -race -count=1 ./...
- name: Generate diff
run: |
git diff origin/${{ github.base_ref }}...origin/${{ github.head_ref }} > pr.diff
- name: Compute new code coverage
id: covdiffaction
uses: panagiotisptr/[email protected]
with:
path: .
coverprofile: full.coverage
diff: pr.diff
module: github.com/teamwork/mailaddress
- name: Comment
uses: mshick/add-pr-comment@v2
with:
message: |
Coverage on new code: ${{ steps.covdiffaction.outputs.covdiff }}%