From c34e78c680973a6336cd5f160319e081e4dc880c Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 20:16:39 +0000 Subject: [PATCH 1/9] Upload postgres tests to DataDog --- .github/workflows/ci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b32a91cab593..e8c4dc22b661f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -298,6 +298,12 @@ jobs: name: gotests-postgres.xml path: ./gotests.xml retention-days: 30 + - name: Upload tests to datadog + run: | + npm install -g @datadog/datadog-ci + datadog-ci junit upload --service coder ./gotests.xml + env: + DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} - uses: codecov/codecov-action@v3 # This action has a tendency to error out unexpectedly, it has From 388d28bddd5248cb381077790a5cb48ccd9f931d Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 20:20:36 +0000 Subject: [PATCH 2/9] fixup! Upload postgres tests to DataDog --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e8c4dc22b661f..3a3e6d15ab4bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -299,6 +299,7 @@ jobs: path: ./gotests.xml retention-days: 30 - name: Upload tests to datadog + if: always() run: | npm install -g @datadog/datadog-ci datadog-ci junit upload --service coder ./gotests.xml From a1e4ea0506ad03a3ebeabeaded9d9358bc1fd825 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 20:30:20 +0000 Subject: [PATCH 3/9] DRY gotestsum --- .github/actions/setup-go/action.yaml | 5 +++++ .github/workflows/ci.yaml | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-go/action.yaml b/.github/actions/setup-go/action.yaml index ae034ba37c24b..c654c1953f652 100644 --- a/.github/actions/setup-go/action.yaml +++ b/.github/actions/setup-go/action.yaml @@ -8,3 +8,8 @@ runs: with: cache: true go-version: "~1.20" + - name: Install gotestsum + uses: jaxxstorm/action-install-gh-release@v1.10.0 + with: + repo: gotestyourself/gotestsum + tag: v1.9.0 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3a3e6d15ab4bb..f39fa3bc3fe80 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -267,14 +267,6 @@ jobs: - uses: ./.github/actions/setup-go - - name: Install gotestsum - uses: jaxxstorm/action-install-gh-release@v1.10.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - repo: gotestyourself/gotestsum - tag: v1.9.0 - - uses: hashicorp/setup-terraform@v2 with: terraform_version: 1.1.9 From f7af439dc79132e96672975dcba8fe918ec0bf57 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 20:41:13 +0000 Subject: [PATCH 4/9] Upload everywhere! --- .github/workflows/ci.yaml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f39fa3bc3fe80..ce2f216c0ba14 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -199,14 +199,6 @@ jobs: - uses: ./.github/actions/setup-go - - name: Install gotestsum - uses: jaxxstorm/action-install-gh-release@v1.10.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - repo: gotestyourself/gotestsum - tag: v1.9.0 - - uses: hashicorp/setup-terraform@v2 with: terraform_version: 1.1.9 @@ -243,6 +235,14 @@ jobs: path: ./gotests.xml retention-days: 30 + - name: Upload tests to datadog + if: always() + run: | + npm install -g @datadog/datadog-ci + datadog-ci junit upload --service coder ./gotests.xml + env: + DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} + - uses: codecov/codecov-action@v3 # This action has a tendency to error out unexpectedly, it has # the `fail_ci_if_error` option that defaults to `false`, but @@ -290,6 +290,7 @@ jobs: name: gotests-postgres.xml path: ./gotests.xml retention-days: 30 + - name: Upload tests to datadog if: always() run: | @@ -325,7 +326,15 @@ jobs: - name: Run Tests run: | - go test -race ./... + gotestsum --junitfile="gotests.xml" -race ./... + + - name: Upload tests to datadog + if: always() + run: | + npm install -g @datadog/datadog-ci + datadog-ci junit upload --service coder ./gotests.xml + env: + DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} deploy: name: "deploy" From 5a90a09ef205a46a199fa17268e08c1d6b5e19db Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 20:43:05 +0000 Subject: [PATCH 5/9] fixup! Upload everywhere! --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ce2f216c0ba14..ae8ea97f1f60e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -326,7 +326,7 @@ jobs: - name: Run Tests run: | - gotestsum --junitfile="gotests.xml" -race ./... + gotestsum --junitfile="gotests.xml" -- -race ./... - name: Upload tests to datadog if: always() From 18198ffd155e586c65264522b6703479d2dc55c7 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 20:47:56 +0000 Subject: [PATCH 6/9] make fmt --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ae8ea97f1f60e..ec25424050f40 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -327,7 +327,7 @@ jobs: - name: Run Tests run: | gotestsum --junitfile="gotests.xml" -- -race ./... - + - name: Upload tests to datadog if: always() run: | From 1308401e1c57d1aa3a8a20bb6060a97c5a91a9b7 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 20:57:54 +0000 Subject: [PATCH 7/9] fixup! make fmt --- .github/actions/upload-datadog/action.yaml | 16 ++++++++++++++++ .github/workflows/ci.yaml | 7 ++----- 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 .github/actions/upload-datadog/action.yaml diff --git a/.github/actions/upload-datadog/action.yaml b/.github/actions/upload-datadog/action.yaml new file mode 100644 index 0000000000000..270c509812046 --- /dev/null +++ b/.github/actions/upload-datadog/action.yaml @@ -0,0 +1,16 @@ +name: Upload tests to datadog +if: always() +inputs: + api-key: + description: "Datadog API key" + required: true +runs: + using: "composite" + steps: + - shell: bash + run: | + npm install -g @datadog/datadog-ci + datadog-ci junit upload --service coder ./gotests.xml \ + --tags "os:${{runner.os}},runner_name:${{runner.name}}" + env: + DATADOG_API_KEY: ${{ inputs.api-key }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec25424050f40..77c8405193914 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -235,12 +235,9 @@ jobs: path: ./gotests.xml retention-days: 30 - - name: Upload tests to datadog + - use: ./.github/actions/upload-datadog if: always() - run: | - npm install -g @datadog/datadog-ci - datadog-ci junit upload --service coder ./gotests.xml - env: + with: DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} - uses: codecov/codecov-action@v3 From 5f6bae205799bd22ecc391dcdb4c79e66191832b Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 21:00:32 +0000 Subject: [PATCH 8/9] globalize --- .github/workflows/ci.yaml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 77c8405193914..5f1e62cfab6ae 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -235,10 +235,10 @@ jobs: path: ./gotests.xml retention-days: 30 - - use: ./.github/actions/upload-datadog + - uses: ./.github/actions/upload-datadog if: always() with: - DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} + api-key: ${{ secrets.DATADOG_API_KEY }} - uses: codecov/codecov-action@v3 # This action has a tendency to error out unexpectedly, it has @@ -288,13 +288,10 @@ jobs: path: ./gotests.xml retention-days: 30 - - name: Upload tests to datadog + - uses: ./.github/actions/upload-datadog if: always() - run: | - npm install -g @datadog/datadog-ci - datadog-ci junit upload --service coder ./gotests.xml - env: - DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} + with: + api-key: ${{ secrets.DATADOG_API_KEY }} - uses: codecov/codecov-action@v3 # This action has a tendency to error out unexpectedly, it has @@ -325,13 +322,10 @@ jobs: run: | gotestsum --junitfile="gotests.xml" -- -race ./... - - name: Upload tests to datadog + - uses: ./.github/actions/upload-datadog if: always() - run: | - npm install -g @datadog/datadog-ci - datadog-ci junit upload --service coder ./gotests.xml - env: - DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} + with: + api-key: ${{ secrets.DATADOG_API_KEY }} deploy: name: "deploy" From b125dae8c9aecb87c314327ca81ba4138eb6b56b Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Thu, 1 Jun 2023 21:16:56 +0000 Subject: [PATCH 9/9] fixup! globalize --- .github/actions/upload-datadog/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/upload-datadog/action.yaml b/.github/actions/upload-datadog/action.yaml index 270c509812046..88d4454aab7c8 100644 --- a/.github/actions/upload-datadog/action.yaml +++ b/.github/actions/upload-datadog/action.yaml @@ -11,6 +11,6 @@ runs: run: | npm install -g @datadog/datadog-ci datadog-ci junit upload --service coder ./gotests.xml \ - --tags "os:${{runner.os}},runner_name:${{runner.name}}" + --tags os:${{runner.os}} --tags runner_name:${{runner.name}} env: DATADOG_API_KEY: ${{ inputs.api-key }}