-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (60 loc) · 1.69 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
name: Test sn-cli
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
test:
concurrency:
group: test
cancel-in-progress: true
strategy:
max-parallel: 1
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.21
-
name: Tests
run: |
go mod tidy
go get github.com/axw/gocov/gocov
go get github.com/AlekSi/gocov-xml
go install github.com/axw/gocov/gocov
go install github.com/AlekSi/gocov-xml
go test -cover -v -failfast -p 1 $(go list ./...) -coverprofile cover.out
gocov convert cover.out | gocov-xml > coverage.xml
if: runner.os != 'Windows'
env:
SN_SERVER: ${{ secrets.SN_SERVER }}
SN_EMAIL: ${{ secrets.SN_EMAIL }}
SN_PASSWORD: ${{ secrets.SN_PASSWORD }}
-
name: Codacy Coverage Reporter
uses: codacy/[email protected]
with:
coverage-reports: coverage.xml
if: runner.os != 'Windows'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
-
name: Windows Tests
run: |
go mod tidy
go test -v -failfast -p 1 $(go list ./...)
if: runner.os != 'Windows'
env:
SN_SERVER: ${{ secrets.SN_SERVER }}
SN_EMAIL: ${{ secrets.SN_EMAIL }}
SN_PASSWORD: ${{ secrets.SN_PASSWORD }}