From 390871b69075d83c8cb5c0fb3049710c74c84ffa Mon Sep 17 00:00:00 2001 From: coffeebeats <108542400+coffeebeats@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:08:13 -0800 Subject: [PATCH 1/5] fix(CI): ensure test command has sufficient timeout --- .github/workflows/check-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-commit.yml b/.github/workflows/check-commit.yml index 026f6095..bb6de8dc 100644 --- a/.github/workflows/check-commit.yml +++ b/.github/workflows/check-commit.yml @@ -142,7 +142,7 @@ jobs: - name: Test source code shell: bash - run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./... + run: go test -v -race -timeout 16m -covermode=atomic -coverprofile=coverage.out ./... - name: Upload coverage report artifact uses: actions/upload-artifact@v3 From d600cdd034f6f2ec1f2627a3b7a61f9d8b456ddf Mon Sep 17 00:00:00 2001 From: coffeebeats <108542400+coffeebeats@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:23:31 -0800 Subject: [PATCH 2/5] fix: apply project flag to default status --- .codecov.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.codecov.yaml b/.codecov.yaml index 6b57b9e2..242c3724 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -1,3 +1,10 @@ +coverage: + status: + project: + default: + flags: + - project + flags: project: carryforward: true From 25e3599d37073e57041f55fb0b3684fd0933ad73 Mon Sep 17 00:00:00 2001 From: coffeebeats <108542400+coffeebeats@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:27:31 -0800 Subject: [PATCH 3/5] fix: apply flag to published report --- .codecov.yaml | 9 +-------- .github/workflows/check-commit.yml | 1 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.codecov.yaml b/.codecov.yaml index 242c3724..0d3f812d 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -1,12 +1,5 @@ -coverage: - status: - project: - default: - flags: - - project - flags: - project: + gdenv: carryforward: true paths: - "*" diff --git a/.github/workflows/check-commit.yml b/.github/workflows/check-commit.yml index bb6de8dc..6b0bf5a1 100644 --- a/.github/workflows/check-commit.yml +++ b/.github/workflows/check-commit.yml @@ -174,6 +174,7 @@ jobs: uses: codecov/codecov-action@v3 with: fail_ci_if_error: true + flags: gdenv token: ${{ secrets.CODECOV_TOKEN }} verbose: true From c9e35d932dd2cb78a86eb2d8245425d9290ec610 Mon Sep 17 00:00:00 2001 From: coffeebeats <108542400+coffeebeats@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:33:40 -0800 Subject: [PATCH 4/5] fix: pass status checks when no changes found --- .codecov.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.codecov.yaml b/.codecov.yaml index 0d3f812d..2358ad50 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -1,3 +1,8 @@ +coverage: + status: + default_rules: + flag_coverage_not_uploaded_behavior: pass + flags: gdenv: carryforward: true From d04754449109e39b2dceec2e7ef6a72d5ce0a578 Mon Sep 17 00:00:00 2001 From: coffeebeats <108542400+coffeebeats@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:47:37 -0800 Subject: [PATCH 5/5] fix: skip coverage if no tests are run --- .codecov.yaml | 5 ----- .github/workflows/check-commit.yml | 36 +----------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/.codecov.yaml b/.codecov.yaml index 2358ad50..0d3f812d 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -1,8 +1,3 @@ -coverage: - status: - default_rules: - flag_coverage_not_uploaded_behavior: pass - flags: gdenv: carryforward: true diff --git a/.github/workflows/check-commit.yml b/.github/workflows/check-commit.yml index 6b0bf5a1..b856c82b 100644 --- a/.github/workflows/check-commit.yml +++ b/.github/workflows/check-commit.yml @@ -144,32 +144,6 @@ jobs: shell: bash run: go test -v -race -timeout 16m -covermode=atomic -coverprofile=coverage.out ./... - - name: Upload coverage report artifact - uses: actions/upload-artifact@v3 - with: - name: coverage.out - path: coverage.out - if-no-files-found: error - - coverage: - needs: ["test"] - if: | - always() && - needs.test.result == 'success' || - needs.test.result == 'skipped' - - runs-on: ubuntu-latest - timeout-minutes: 2 - - steps: - - uses: actions/checkout@v4 - - - name: Download coverage report artifact - uses: actions/download-artifact@v3 - continue-on-error: true # OK if coverage is missing. - with: - name: coverage.out - - name: Upload coverage report to Codecov uses: codecov/codecov-action@v3 with: @@ -181,7 +155,7 @@ jobs: # Used to ensure all branch protection requirements are met. This is a workaround until # https://github.com/github-community/community/discussions/4324 is addressed. branch_protection: - needs: ["coverage", "format", "lint", "build", "test"] + needs: ["format", "lint", "build", "test"] if: ${{ always() }} runs-on: ubuntu-latest @@ -192,14 +166,6 @@ jobs: shell: bash steps: - - name: Verify 'coverage' status - if: | - always() && - needs.coverage.result == 'failure' || - needs.coverage.result == 'cancelled' - shell: bash - run: exit 1 - - name: Verify 'format' status if: | always() &&