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

Add coverage action and badge #184

Closed
wants to merge 4 commits into from
Closed
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
25 changes: 24 additions & 1 deletion .github/workflows/ci-temporal-integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
tests:
name: "Integration testing"
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v3
- name: "Set up temporal environment"
Expand All @@ -17,4 +21,23 @@ jobs:
run: make ci-temporal-integ-test
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
uses: jwalton/gh-docker-logs@v2
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v1
with:
filename: coverage.out

- uses: stefanzweifel/git-auto-commit-action@v4
id: auto-commit-action
with:
commit_message: Apply Code Coverage Badge
skip_fetch: true
skip_checkout: true
file_pattern: ./README.md

- name: Push Changes
if: steps.auto-commit-action.outputs.changes_detected == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ deps-all: ## Check for all dependency updates
cleanTestCache:
$Q go clean -testcache

integTestsWithCover:
$Q go test -v -cover ./integ -coverprofile coverage.out -coverpkg ./... -search=false -cadence=false
$Q go tool cover -func coverage.out -o coverage.out # Replaces coverage.out with the analysis of coverage.out
integTestsTemporalWithCover: # for local debugging
$Q go test -v -cover ./integ -coverprofile coverage.out -coverpkg ./service/... -cadence=false
$Q go tool cover -func coverage.out -o coverage.out

integTests:
$Q go test -v ./integ
Expand All @@ -180,8 +180,8 @@ ci-cadence-integ-test:
$Q go test -v ./integ -search=false -temporal=false -dependencyWaitSeconds=180

ci-temporal-integ-test:
$Q go test -v -cover ./integ -coverprofile coverage.out -coverpkg ./... -search=false -cadence=false -dependencyWaitSeconds=60
$Q go tool cover -func coverage.out -o coverage.out # Replaces coverage.out with the analysis of coverage.out
$Q go test -v -cover ./integ -coverprofile coverage.out -coverpkg ./service/... -search=false -cadence=false -dependencyWaitSeconds=60
$Q go tool cover -func coverage.out -o coverage.out

integTestsNoSearch:
$Q go test -v ./integ -search=false
Expand Down
Loading