-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 1.63 KB
/
tests.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
---
name: Tests
"on":
- push
- pull_request
jobs:
lint:
permissions:
contents: read
pull-requests: read
name: lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6.1.1
with:
version: v1.45.0
args: --timeout=3m
skip-go-installation: true
tests:
name: tests ${{ matrix.go }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { go: "1.18", os: "ubuntu-latest" }
- { go: "1.18", os: "macos-latest" }
- { go: "1.18", os: "windows-latest" }
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Run tests
run: go test -v ./...
coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.18"
- name: Run coverage
run: go test ./... -failfast -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)