-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 1.94 KB
/
ci.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: ksd-ci
on:
push:
branches: [ main ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
ci:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
binary: ksd
artifact: ksd.linux
- os: windows-latest
binary: ksd.exe
artifact: ksd.windows
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- name: Build
run: go build
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Test (PR)
if: ${{ github.event_name == 'pull_request' }}
run: >
gotestsum
--format testname
--
-race
-coverprofile='coverage.txt'
-covermode=atomic
-coverpkg='./...'
./...
- name: Test (Full)
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
run: >
gotestsum
--format testname
--
-race
-coverprofile='coverage.txt'
-covermode=atomic
-coverpkg='./...'
./...
env:
KSD_TEST_CLIENT_SECRET: ${{ secrets.KSD_TEST_CLIENT_SECRET }}
KSD_TEST_CLIENT_ID: ${{ vars.KSD_TEST_CLIENT_ID }}
KSD_TEST_TENANT_ID: ${{ vars.KSD_TEST_TENANT_ID }}
KSD_TEST_ENDPOINT: ${{ vars.KSD_TEST_ENDPOINT }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
with:
name: ${{ matrix.artifact }}
path: |
${{ matrix.binary }}