-
Notifications
You must be signed in to change notification settings - Fork 10
48 lines (45 loc) · 1.08 KB
/
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
43
44
45
46
47
48
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: [ master ]
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/*.yml'
permissions:
contents: read
pull-requests: read
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang env
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false # conflict with golangci-lint cache
- name: lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.54
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang env
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Unit Test
run: go test -v -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}