-
Notifications
You must be signed in to change notification settings - Fork 55
117 lines (95 loc) · 2.93 KB
/
main.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Main Workflow
on:
pull_request: {}
push:
branches: [ "main" ]
concurrency:
group: one-at-time
cancel-in-progress: false
permissions:
contents: read
jobs:
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- name: Check that docs were generated
run: make check-docs
- name: Check for linting errors
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # [email protected]
with:
version: latest
args: -v -c .golangci.yml
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- name: Run unit tests
run: make test-unit
- name: Upload unit test coverage
uses: actions/upload-artifact@v3
with:
name: unit-tests-artifact
path: ./coverage-unit-tests.out
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
needs: unit-tests
# Skip running if the PR is coming from a fork or is created by dependabot or snyk due to missing repo secrets.
if: github.event.pull_request.head.repo.fork == false && (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')
steps:
- name: Check out the code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- name: Run integration tests
shell: bash
run: make test-integration
env:
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}
- name: Download unit test coverage
uses: actions/download-artifact@v3
with:
name: unit-tests-artifact
path: ./unit-tests-artifact
- name: Update codecov report
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # [email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit-tests-artifact/coverage-unit-tests.out,./coverage-integration-tests.out
fail_ci_if_error: false
verbose: true
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- name: Ensure binaries can be built for all platforms
run: make build-all-platforms