-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (62 loc) · 2.13 KB
/
ci.yaml
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
62
63
64
65
66
67
68
69
name: Test
on: [push]
env:
HEALTH_CRM_AUTH_SERVER_ENDPOINT: ${{ secrets.HEALTH_CRM_AUTH_SERVER_ENDPOINT }}
HEALTH_CRM_CLIENT_ID: ${{ secrets.HEALTH_CRM_CLIENT_ID }}
HEALTH_CRM_CLIENT_SECRET: ${{ secrets.HEALTH_CRM_CLIENT_SECRET }}
HEALTH_CRM_GRANT_TYPE: ${{ secrets.HEALTH_CRM_GRANT_TYPE }}
HEALTH_CRM_USERNAME: ${{ secrets.HEALTH_CRM_USERNAME }}
HEALTH_CRM_PASSWORD: ${{ secrets.HEALTH_CRM_PASSWORD }}
HEALTH_CRM_BASE_URL: ${{ secrets.HEALTH_CRM_BASE_URL }}
jobs:
golangci:
strategy:
matrix:
go-version: [1.23.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
lint_and_test:
needs: [golangci]
strategy:
matrix:
go-version: [1.23.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 80
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Install Go dependencies
run: |
go mod download
go get github.com/axw/gocov/gocov
go get github.com/ory/go-acc
go install github.com/ory/go-acc
go install github.com/axw/gocov/gocov
go get github.com/savannahghi/[email protected]
- name: Run tests
run: |
go-acc -o coverage.txt --ignore generated,cmd ./... -- -timeout 60m
grep -v "generated.go" coverage.txt > coverage.out
go tool cover -html=coverage.out -o coverage.html
gocov convert coverage.out > coverage.json
gocov report coverage.json > coverage_report.txt
tail coverage_report.txt
- name: Install goveralls
run: GO111MODULE=on go install github.com/mattn/goveralls@latest
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.out -service=github