-
-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (46 loc) · 1.22 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
name: Test
on:
push:
tags:
branches:
- master
pull_request:
jobs:
test:
strategy:
matrix:
go-version: [ 1.21.x ]
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- run: |
go test -coverprofile=coverage.out -coverpkg=./... -covermode=count ./internal/...
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')
echo "Total coverage: $COVERAGE"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-latest'
- name: Run BATS tests
uses: mig4/setup-bats@v1
with:
bats-version: 1.9.0
- run: |
make build
bats bats/test.bats
test_windows:
strategy:
matrix:
go-version: [ 1.21.x ]
os: [ windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- run: |
go test ./internal/...