From ede2b5c79285b87001924fb4ba58b801e0edb596 Mon Sep 17 00:00:00 2001 From: John Murret Date: Wed, 26 Apr 2023 15:51:04 +0000 Subject: [PATCH] backport of commit 759c8e93d656b3ebbc1d0846e7c3551614fd408a --- .github/workflows/go-tests.yml | 1 - .github/workflows/reusable-unit-split.yml | 13 +++++++++++++ .github/workflows/reusable-unit.yml | 13 +++++++++++++ .github/workflows/test-integrations.yml | 12 ++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 268b951b576d..e92f8e29bfc4 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -21,7 +21,6 @@ permissions: env: TEST_RESULTS: /tmp/test-results - GOTESTSUM_VERSION: 1.8.2 jobs: setup: diff --git a/.github/workflows/reusable-unit-split.yml b/.github/workflows/reusable-unit-split.yml index 0131582b0bef..6cd6212cc4a6 100644 --- a/.github/workflows/reusable-unit-split.yml +++ b/.github/workflows/reusable-unit-split.yml @@ -128,6 +128,19 @@ jobs: -tags="${{env.GOTAGS}}" -p 2 \ ${GO_TEST_FLAGS-} \ -cover -coverprofile=coverage.txt + + - name: prepare datadog-ci + if: ${{ !endsWith(github.repository, '-enterprise') }} + 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 coverage + env: + DATADOG_API_KEY: "${{ secrets.DATADOG_API_KEY }}" + DD_ENV: ci + run: datadog-ci junit upload --service "$GITHUB_REPOSITORY" ${{env.TEST_RESULTS}}/gotestsum-report.xml + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v3.1.2 with: name: test-results diff --git a/.github/workflows/reusable-unit.yml b/.github/workflows/reusable-unit.yml index fde340bd5edc..8667a38a2985 100644 --- a/.github/workflows/reusable-unit.yml +++ b/.github/workflows/reusable-unit.yml @@ -96,6 +96,19 @@ jobs: -tags="${{env.GOTAGS}}" \ ${GO_TEST_FLAGS-} \ -cover -coverprofile=coverage.txt + + - name: prepare datadog-ci + if: ${{ !endsWith(github.repository, '-enterprise') }} + 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 coverage + env: + DATADOG_API_KEY: "${{ secrets.DATADOG_API_KEY }}" + DD_ENV: ci + run: datadog-ci junit upload --service "$GITHUB_REPOSITORY" ${{env.TEST_RESULTS}}/gotestsum-report.xml + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v3.1.2 with: name: test-results diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 4dc1bb427ca3..047b16f94960 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -92,6 +92,18 @@ jobs: --packages="./command/agent/consul" \ --junitfile $TEST_RESULTS_DIR/results.xml -- \ -run TestConsul + + - name: prepare datadog-ci + if: ${{ !endsWith(github.repository, '-enterprise') }} + 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 coverage + env: + DATADOG_API_KEY: "${{ secrets.DATADOG_API_KEY }}" + DD_ENV: ci + run: datadog-ci junit upload --service "$GITHUB_REPOSITORY" $TEST_RESULTS_DIR/results.xml vault-integration-test: runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }}