mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
ci: Replace DataDog CI with custom upload script (#169)
* ci: Replace DataDog CI with custom upload script This will reduce CI time by ~6 minutes across all of our runners. It's a bit janky, but I believe worth the slight maintainance burden. * Fix test race when job would complete too early * Fix job cancelation override * Fix race where provisioner job is inserted before project version
This commit is contained in:
@@ -159,45 +159,27 @@ jobs:
|
||||
-covermode=atomic -coverprofile="gotests.coverage"
|
||||
-timeout=3m -count=5 -race -short -parallel=2
|
||||
|
||||
- name: Upload DataDog Trace
|
||||
if: (success() || failure()) && github.actor != 'dependabot[bot]'
|
||||
env:
|
||||
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
|
||||
DD_DATABASE: fake
|
||||
GIT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
run: go run scripts/datadog-cireport/main.go gotests.xml
|
||||
|
||||
- name: Test with PostgreSQL Database
|
||||
if: runner.os == 'Linux'
|
||||
run: DB=true gotestsum --junitfile="gotests.xml" --packages="./..." --
|
||||
-covermode=atomic -coverprofile="gotests.coverage" -timeout=3m
|
||||
-count=1 -race -parallel=2
|
||||
|
||||
- name: Setup Node for DataDog CLI
|
||||
uses: actions/setup-node@v2
|
||||
if: always() && github.actor != 'dependabot[bot]'
|
||||
with:
|
||||
node-version: "14"
|
||||
|
||||
- name: Cache DataDog CLI
|
||||
if: always() && github.actor != 'dependabot[bot]'
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.npm
|
||||
%LocalAppData%\npm-cache
|
||||
key: datadogci-
|
||||
restore-keys: datadogci-
|
||||
|
||||
- name: Upload DataDog Trace
|
||||
if: always() && github.actor != 'dependabot[bot]'
|
||||
# See: https://docs.datadoghq.com/continuous_integration/setup_tests/junit_upload/#collecting-environment-configuration-metadata
|
||||
if: (success() || failure()) && github.actor != 'dependabot[bot]'
|
||||
env:
|
||||
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
|
||||
DD_GIT_REPOSITORY_URL: ${{ github.repositoryUrl }}
|
||||
DD_GIT_BRANCH: ${{ github.head_ref }}
|
||||
DD_GIT_COMMIT_SHA: ${{ github.sha }}
|
||||
DD_GIT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
DD_GIT_COMMIT_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
|
||||
DD_GIT_COMMIT_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
|
||||
DD_GIT_COMMIT_COMMITTER_NAME: ${{ github.event.head_commit.committer.name }}
|
||||
DD_GIT_COMMIT_COMMITTER_EMAIL: ${{ github.event.head_commit.committer.email }}
|
||||
DD_TAGS: ${{ format('os.platform:{0},os.architecture:{1}', runner.os, runner.arch) }}
|
||||
run: |
|
||||
npm install -g @datadog/datadog-ci
|
||||
datadog-ci junit upload --service coder gotests.xml
|
||||
DD_DATABASE: postgresql
|
||||
GIT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
run: go run scripts/datadog-cireport/main.go gotests.xml
|
||||
|
||||
- uses: codecov/codecov-action@v2
|
||||
if: github.actor != 'dependabot[bot]'
|
||||
|
||||
Reference in New Issue
Block a user