-
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.24 KB
/
test.yml
File metadata and controls
61 lines (51 loc) · 1.24 KB
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
name: Test
on:
push:
branches:
- main
pull_request:
#
# Cancel outdated runs for the same branch / PR
#
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
go:
name: Go - test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
coverage: true
- os: windows-2022
coverage: false
- os: macos-15
coverage: false
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set-up Go
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: test
run: |
if [[ "${{ matrix.coverage }}" == "true" ]]; then
go test -covermode=atomic -coverpkg=./... -coverprofile=coverage.out -tags=integration ./...
go tool cover -func=coverage.out
else
go test -tags=integration ./...
fi
- name: check test coverage
if: matrix.coverage == true
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml