-
-
Notifications
You must be signed in to change notification settings - Fork 48
61 lines (53 loc) · 1.53 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
on:
push:
branches-ignore:
- allcontributors/**
- docs
- gh-pages
pull_request:
branches-ignore:
- '*'
name: Test
jobs:
tests:
strategy:
matrix:
go-version: [1.20.x]
platform: [macos-latest, ubuntu-latest] # , windows-latest // TODO: Review Tests on windows
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: |
go test -cover -coverprofile=${{ matrix.platform }}_coverage.out ./...
go tool cover -func=${{ matrix.platform }}_coverage.out
- name: Upload coverage report
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.platform }}_coverage
path: ${{ matrix.platform }}_coverage.out
coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- name: Download coverage report
uses: actions/download-artifact@v1
with:
name: ubuntu-latest_coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}