From 20e1b428cbe365e6c31306cf2719d540f368a08f Mon Sep 17 00:00:00 2001 From: Kuba Wieczorek Date: Fri, 31 Mar 2023 17:15:57 +0000 Subject: [PATCH] backport of commit 45f349dc365fe3c3f3863e6403512b72cd24892f --- .github/workflows/test-go.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/test-go.yml b/.github/workflows/test-go.yml index c23092a1fe61..bbed86baf779 100644 --- a/.github/workflows/test-go.yml +++ b/.github/workflows/test-go.yml @@ -105,6 +105,7 @@ jobs: caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }} token: ${{ steps.vault-auth.outputs.token }} secrets: | + kv/data/github/${{ github.repository }}/datadog-ci DATADOG_API_KEY; kv/data/github/${{ github.repository }}/license license_1 | VAULT_LICENSE_CI; kv/data/github/${{ github.repository }}/license license_2 | VAULT_LICENSE_2; kv/data/github/${{ github.repository }}/hcp-link HCP_API_ADDRESS; @@ -166,6 +167,21 @@ jobs: ${{ inputs.extra-flags }} \ \ ${test_packages[${{ matrix.runner-index }}]} + - name: Prepare datadog-ci + if: github.repository == 'hashicorp/vault' + continue-on-error: true + run: | + curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64" --output "/usr/local/bin/datadog-ci" + chmod +x /usr/local/bin/datadog-ci + - name: Upload test results to DataDog + continue-on-error: true + env: + DD_ENV: ci + run: | + if [[ ${{ github.repository }} == 'hashicorp/vault' ]]; then + export DATADOG_API_KEY=${{ secrets.DATADOG_API_KEY }} + fi + datadog-ci junit upload --service "$GITHUB_REPOSITORY" test-results/go-test/results.xml - name: Archive test results uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce with: