From 8984d19027fe75b0de572407ca1688317d1d86f4 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 13 Dec 2022 09:35:50 +0100 Subject: [PATCH 1/5] chore: Use datadog-ci to collect gotests.xml --- .github/workflows/coder.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index a5bb412ebc67e..ef32d46a720a2 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -348,6 +348,15 @@ jobs: path: ./gotestsum.json retention-days: 7 + - uses: datadog/junit-upload-github-action@v1 + # TODO github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork + if: success() || failure() + with: + api-key: ${{ secrets.DD_API_KEY }} + service: "coder-gotests" + tags: "test_suite:${{ matrix.os }}" + files: ./gotests.xml + - 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 @@ -416,6 +425,15 @@ jobs: path: ./gotestsum.json retention-days: 7 + - uses: datadog/junit-upload-github-action@v1 + # TODO github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork + if: success() || failure() + with: + api-key: ${{ secrets.DD_API_KEY }} + service: "coder-gotests" + tags: "test_suite:postgres" + files: ./gotests.xml + - 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 From 11ed3b8fe39be81c47787ee9945ac3ec8b558f83 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 13 Dec 2022 09:47:27 +0100 Subject: [PATCH 2/5] WIP --- .github/workflows/coder.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index ef32d46a720a2..5aed000a0bd9e 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -349,12 +349,12 @@ jobs: retention-days: 7 - uses: datadog/junit-upload-github-action@v1 - # TODO github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork - if: success() || failure() + if: "!github.event.pull_request.head.repo.fork && (success() || failure())" with: api-key: ${{ secrets.DD_API_KEY }} service: "coder-gotests" tags: "test_suite:${{ matrix.os }}" + env: "{{ github.ref == 'refs/heads/main' && 'main' || 'pull_request' }}" files: ./gotests.xml - uses: codecov/codecov-action@v3 @@ -426,12 +426,12 @@ jobs: retention-days: 7 - uses: datadog/junit-upload-github-action@v1 - # TODO github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork - if: success() || failure() + if: "!github.event.pull_request.head.repo.fork && (success() || failure())" with: api-key: ${{ secrets.DD_API_KEY }} service: "coder-gotests" tags: "test_suite:postgres" + env: "{{ github.ref == 'refs/heads/main' && 'main' || 'pull_request' }}" files: ./gotests.xml - uses: codecov/codecov-action@v3 From e64332248cc1d901144d23fe255ed6861481e6cb Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 13 Dec 2022 09:59:14 +0100 Subject: [PATCH 3/5] Fix: github ref --- .github/workflows/coder.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index 5aed000a0bd9e..eae3f9b66e203 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -349,12 +349,11 @@ jobs: retention-days: 7 - uses: datadog/junit-upload-github-action@v1 - if: "!github.event.pull_request.head.repo.fork && (success() || failure())" + if: success() || failure() with: api-key: ${{ secrets.DD_API_KEY }} service: "coder-gotests" - tags: "test_suite:${{ matrix.os }}" - env: "{{ github.ref == 'refs/heads/main' && 'main' || 'pull_request' }}" + tags: "test_suite:${{ matrix.os }},github_ref:${{github.ref}}" files: ./gotests.xml - uses: codecov/codecov-action@v3 @@ -426,12 +425,11 @@ jobs: retention-days: 7 - uses: datadog/junit-upload-github-action@v1 - if: "!github.event.pull_request.head.repo.fork && (success() || failure())" + if: success() || failure() with: api-key: ${{ secrets.DD_API_KEY }} service: "coder-gotests" - tags: "test_suite:postgres" - env: "{{ github.ref == 'refs/heads/main' && 'main' || 'pull_request' }}" + tags: "test_suite:${{ matrix.os }},github_ref:${{github.ref}}" files: ./gotests.xml - uses: codecov/codecov-action@v3 From 6423c46a04cbd2971171190b9003e3baea2dbc91 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 13 Dec 2022 10:05:31 +0100 Subject: [PATCH 4/5] fix --- .github/workflows/coder.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index eae3f9b66e203..a95f5f39de8e5 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -429,7 +429,7 @@ jobs: with: api-key: ${{ secrets.DD_API_KEY }} service: "coder-gotests" - tags: "test_suite:${{ matrix.os }},github_ref:${{github.ref}}" + tags: "test_suite:postgres,github_ref:${{github.ref}}" files: ./gotests.xml - uses: codecov/codecov-action@v3 From 9e2c3fbe9cb29071e7f1589c255ae3b704bacb67 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Wed, 14 Dec 2022 10:41:20 +0100 Subject: [PATCH 5/5] just store gotests.xml --- .github/workflows/coder.yaml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index a95f5f39de8e5..c33a3f20e6dcb 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -348,13 +348,12 @@ jobs: path: ./gotestsum.json retention-days: 7 - - uses: datadog/junit-upload-github-action@v1 + - uses: actions/upload-artifact@v3 if: success() || failure() with: - api-key: ${{ secrets.DD_API_KEY }} - service: "coder-gotests" - tags: "test_suite:${{ matrix.os }},github_ref:${{github.ref}}" - files: ./gotests.xml + name: gotests-${{ matrix.os }}.xml + path: ./gotests.xml + retention-days: 30 - uses: codecov/codecov-action@v3 # This action has a tendency to error out unexpectedly, it has @@ -424,13 +423,12 @@ jobs: path: ./gotestsum.json retention-days: 7 - - uses: datadog/junit-upload-github-action@v1 + - uses: actions/upload-artifact@v3 if: success() || failure() with: - api-key: ${{ secrets.DD_API_KEY }} - service: "coder-gotests" - tags: "test_suite:postgres,github_ref:${{github.ref}}" - files: ./gotests.xml + name: gotests-postgres.xml + path: ./gotests.xml + retention-days: 30 - uses: codecov/codecov-action@v3 # This action has a tendency to error out unexpectedly, it has