Skip to content

Commit 1a32a83

Browse files
committed
ci: Add DataDog tracing
1 parent 65de6ee commit 1a32a83

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/coder.yaml

+22-4
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,34 @@ jobs:
155155
terraform_wrapper: false
156156

157157
- name: Test with Mock Database
158-
run: gotestsum --jsonfile="gotests.json" --packages="./..." --
159-
-covermode=atomic -coverprofile="gotests.coverage" -timeout=3m
160-
-count=5 -race -short -parallel=2
158+
run: gotestsum --junitfile="gotests.xml" --packages="./..." --
159+
-covermode=atomic -coverprofile="gotests.coverage"
160+
-timeout=3m -count=5 -race -short -parallel=2
161161

162162
- name: Test with PostgreSQL Database
163163
if: runner.os == 'Linux'
164-
run: DB=true gotestsum --jsonfile="gotests.json" --packages="./..." --
164+
run: DB=true gotestsum --junitfile="gotests.xml" --packages="./..." --
165165
-covermode=atomic -coverprofile="gotests.coverage" -timeout=3m
166166
-count=1 -race -parallel=2
167167

168+
- uses: actions/setup-node@v2
169+
if: always()
170+
with:
171+
node-version: "14"
172+
173+
- name: Upload DataDog Trace
174+
if: always()
175+
# See: https://docs.datadoghq.com/continuous_integration/setup_tests/junit_upload/#collecting-environment-configuration-metadata
176+
env:
177+
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
178+
DD_GIT_REPOSITORY_URL: ${{ github.repositoryUrl }}
179+
DD_GIT_BRANCH: ${{ github.base_ref }}
180+
DD_GIT_COMMIT_SHA: ${{ github.sha }}
181+
DD_TAGS: ${{ format('os.platform:{0},os.architecture:{1}', runner.os, runner.arch) }}
182+
run: |
183+
npm install -g @datadog/datadog-ci
184+
datadog-ci junit upload --service coder gotests.xml
185+
168186
- uses: codecov/codecov-action@v2
169187
if: github.actor != 'dependabot[bot]'
170188
with:

0 commit comments

Comments
 (0)