-
Notifications
You must be signed in to change notification settings - Fork 35
93 lines (82 loc) · 2.61 KB
/
coveritup.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
83
84
85
86
87
88
89
90
91
92
93
on:
pull_request:
push:
tags-ignore:
- '**'
branches:
- '**'
name: "Cover It Up v2"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
coveritup:
strategy:
matrix:
go-version: [latest]
node-version: [20]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: kevincobain2000/action-gobrew@v2
with:
version: ${{ matrix.go-version }}
- name: Setup Node.js 20
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Tools
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install github.com/axw/gocov/gocov@latest
go install github.com/AlekSi/gocov-xml@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh
- name: NPM Install
uses: kevincobain2000/action-coveritup@v2
with:
type: npm-install-time
command: cd frontend; npm install
record: runtime
- name: NPM Build
uses: kevincobain2000/action-coveritup@v2
with:
type: npm-build-time
command: cd frontend; npm run build
record: runtime
- name: Go Mod Tidy
run: go mod tidy
- name: Go Build
uses: kevincobain2000/action-coveritup@v2
with:
type: go-build-time
command: go build main.go
record: runtime
- name: Test
uses: kevincobain2000/action-coveritup@v2
with:
type: go-test-runtime
command: go test -race -v ./... -count=1 -coverprofile=coverage.out
record: runtime
metric: sec
- name: Coverage
run: gocov convert coverage.out | gocov-xml > coverage.xml
- name: Coverage Cover Totalizer
uses: kevincobain2000/action-coveritup@v2
with:
type: coverage
command: ./cover-totalizer coverage.xml
- name: Go Binary Size
uses: kevincobain2000/action-coveritup@v2
with:
type: go-binary-size
command: du -sk main | awk '{print $1}'
- name: Number of dependencies
uses: kevincobain2000/action-coveritup@v2
with:
type: go-mod-dependencies
command: go list -m all|wc -l|awk '{$1=$1};1'
- uses: kevincobain2000/action-coveritup@v2
with:
pr_comment: true