Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CI): ensure go test command has sufficient timeout #144

Merged
merged 5 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codecov.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flags:
project:
gdenv:
carryforward: true
paths:
- "*"
39 changes: 3 additions & 36 deletions .github/workflows/check-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,45 +142,20 @@ jobs:

- name: Test source code
shell: bash
run: go test -v -race -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
run: go test -v -race -timeout 16m -covermode=atomic -coverprofile=coverage.out ./...

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
flags: gdenv
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

# 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
Expand All @@ -191,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() &&
Expand Down