-
Notifications
You must be signed in to change notification settings - Fork 216
42 lines (33 loc) · 1013 Bytes
/
ci.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
name: ci
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
tags: ["*"]
permissions:
contents: read
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version: '1.20'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
with:
version: latest
skip-cache: true
- name: Run Go tests and generate coverage report
run: go test -v -race ./... -coverprofile=coverage.out
- name: Upload the coverage report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
path: coverage.out
name: Coverage-report
- name: Display Coverage Report
run: go tool cover -func=coverage.out
- name: Build Go
run: go build ./...