-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.12 KB
/
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
name: test
on: [ push, pull_request ]
jobs:
test:
strategy:
matrix:
go: [
'1.22',
]
os: [
ubuntu-latest,
macos-latest,
windows-latest,
]
working-dir: [
'.',
'tenant'
]
defaults:
run:
working-directory: ${{ matrix.working-dir }}
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
WORKING_DIR: ${{ matrix.working-dir }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Test
run: go test -v -race -coverprofile="coverage.txt" -covermode=atomic $(go list ./... | grep -v examples)
- name: Upload code coverage
uses: codecov/codecov-action@v4
if: matrix.go == '1.22'
with:
file: coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,WORKING_DIR
name: "${{ matrix.go }}-${{ matrix.os }}-${{ matrix.working-dir }}"