-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (43 loc) · 1.16 KB
/
go-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
45
46
47
48
49
50
51
52
53
name: Go CI
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [main, develop]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.22']
env:
GO111MODULE: "on"
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Cache Go Modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
${{ runner.os }}-go-
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
args: --timeout=30m
- name: Install Dependencies
run: |
go mod tidy
go mod download
- name: Run Tests with Coverage
run: |
go test -v -count=1 -cover -run ^TestMock ./...