forked from pomerium/pomerium
-
Notifications
You must be signed in to change notification settings - Fork 0
229 lines (205 loc) · 5.92 KB
/
test.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
on:
push:
branches:
- master
pull_request:
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.17.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: set env vars
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: cache go binaries
uses: actions/cache@v2
id: cache-go-bin
with:
path: ~/go/bin
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
restore-keys: ${{ runner.os }}-go-bin
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: make deps-build
- name: Lint
if: runner.os == 'Linux'
run: make lint
- name: spellcheck
if: runner.os == 'Linux'
run: make spellcheck
- name: test
if: runner.os != 'Linux'
run: make test
cover:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17.x
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: set env vars
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: cache go binaries
uses: actions/cache@v2
id: cache-go-bin
with:
path: ~/go/bin
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
restore-keys: ${{ runner.os }}-go-bin
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: cover
run: make cover
- uses: jandelgado/gcov2lcov-action@v1.0.8
name: convert coverage to lcov
with:
infile: coverage.txt
outfile: coverage.lcov
- name: upload to coveralls
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
integration:
strategy:
fail-fast: false
matrix:
go-version: [1.17.x]
platform: [ubuntu-latest]
deployment: [kubernetes, multi, nginx, single, traefik]
idp: [auth0, azure, github, gitlab, google, oidc, okta, onelogin, ping]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: set env vars
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
~/go/pkg
~/.cache/go-build
~/Library/Caches/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: build dev docker image
run: |
./scripts/build-dev-docker.bash
- name: start cluster
run: |
export POMERIUM_TAG=dev
cd ./integration/clusters/${{matrix.idp}}-${{matrix.deployment}}
docker-compose up -d
- name: integration tests
run: |
(cd ./integration/clusters/${{matrix.idp}}-${{matrix.deployment}} && docker-compose logs -f &)
go test -v ./integration/...
build:
strategy:
matrix:
go-version: [1.17.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: build
run: |
make build-deps
make build
make build NAME=pomerium-cli
- name: save binary
uses: actions/upload-artifact@v2
with:
path: bin/pomerium*
name: pomerium ${{ github.run_id }} ${{ matrix.platform }}
retention-days: 1
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: build
run: docker build .
precommit:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: 1.17.x
- uses: actions/setup-python@v2
- uses: pre-commit/action@release
with:
extra_args: --show-diff-on-failure --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
env:
SKIP: lint
license:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.17.x]
platform: [ubuntu-latest]
needs:
- build
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17.x
- uses: actions/checkout@v2
- name: retrieve binary
uses: actions/download-artifact@v2
with:
name: pomerium ${{ github.run_id }} ${{ matrix.platform }}
path: bin/
- name: download envoy
run: make get-envoy
- name: FOSSA Scan
uses: fossa-contrib/fossa-action@v1
with:
fossa-api-key: 18f4ef488f514d06874b75f5809cea93