@@ -185,8 +185,56 @@ jobs:
185
185
GIT_COMMIT_MESSAGE : ${{ github.event.head_commit.message }}
186
186
run : go run scripts/datadog-cireport/main.go gotests.xml
187
187
188
+ - uses : codecov/codecov-action@v2
189
+ if : github.actor != 'dependabot[bot]'
190
+ with :
191
+ token : ${{ secrets.CODECOV_TOKEN }}
192
+ files : ./gotests.coverage
193
+ flags : unittest-go-${{ matrix.os }}
194
+ fail_ci_if_error : true
195
+
196
+ test-go-postgres :
197
+ name : " test/go/postgres"
198
+ runs-on : ubuntu-latest
199
+ steps :
200
+ - uses : actions/checkout@v3
201
+
202
+ - uses : actions/setup-go@v2
203
+ with :
204
+ go-version : " ^1.17"
205
+
206
+ - name : Echo Go Cache Paths
207
+ id : go-cache-paths
208
+ run : |
209
+ echo "::set-output name=go-build::$(go env GOCACHE)"
210
+ echo "::set-output name=go-mod::$(go env GOMODCACHE)"
211
+
212
+ - name : Go Build Cache
213
+ uses : actions/cache@v3
214
+ with :
215
+ path : ${{ steps.go-cache-paths.outputs.go-build }}
216
+ key : ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
217
+
218
+ - name : Go Mod Cache
219
+ uses : actions/cache@v3
220
+ with :
221
+ path : ${{ steps.go-cache-paths.outputs.go-mod }}
222
+ key : ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
223
+
224
+ - name : Install goreleaser
225
+ uses : jaxxstorm/action-install-gh-release@v1.4.0
226
+ env :
227
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
228
+ with :
229
+ repo : gotestyourself/gotestsum
230
+ tag : v1.7.0
231
+
232
+ - uses : hashicorp/setup-terraform@v1
233
+ with :
234
+ terraform_version : 1.1.2
235
+ terraform_wrapper : false
236
+
188
237
- name : Start PostgreSQL Database
189
- if : runner.os == 'Linux'
190
238
env :
191
239
POSTGRES_PASSWORD : postgres
192
240
POSTGRES_USER : postgres
@@ -209,28 +257,19 @@ jobs:
209
257
done
210
258
211
259
- name : Test with PostgreSQL Database
212
- if : runner.os == 'Linux'
213
260
run : DB=ci gotestsum --junitfile="gotests.xml" --packages="./..." --
214
261
-covermode=atomic -coverprofile="gotests.coverage" -timeout=3m
215
262
-coverpkg=./...,github.com/coder/coder/codersdk
216
263
-count=1 -parallel=2 -race -failfast
217
264
218
265
- name : Upload DataDog Trace
219
- if : (success() || failure()) && github.actor != 'dependabot[bot]' && runner.os == 'Linux'
266
+ if : (success() || failure()) && github.actor != 'dependabot[bot]'
220
267
env :
221
268
DATADOG_API_KEY : ${{ secrets.DATADOG_API_KEY }}
222
269
DD_DATABASE : postgresql
223
270
GIT_COMMIT_MESSAGE : ${{ github.event.head_commit.message }}
224
271
run : go run scripts/datadog-cireport/main.go gotests.xml
225
272
226
- - uses : codecov/codecov-action@v2
227
- if : github.actor != 'dependabot[bot]'
228
- with :
229
- token : ${{ secrets.CODECOV_TOKEN }}
230
- files : ./gotests.coverage
231
- flags : unittest-go-${{ matrix.os }}
232
- fail_ci_if_error : true
233
-
234
273
deploy :
235
274
name : " deploy"
236
275
runs-on : ubuntu-latest
0 commit comments