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

[QA-184] Added octocov unit test coverage report #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 25 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

name: octocov
on:
push:
branches:
- master
pull_request:

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Granting private modules access
run: |
git config --global url."https://${{ secrets.engbot_token }}:[email protected]/watchtowerai".insteadOf "https://github.com/watchtowerai"
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- name: Run tests with coverage report output
# can skip packages with external dependencies (e.g. entity with live DB) with a command like
# ```go test $(go list ./... | grep -v entity) -coverprofile=coverage.out```
run: go test $(go list ./... | grep -v /internal/services/entity | grep -v /internal/entities | grep -v /internal/handler | grep -v /internal/services/entity) -coverprofile=coverage.out
env:
GO_ENV: "test"
GOPRIVATE: "github.com/watchtowerai"
- uses: k1LoW/octocov-action@v0
21 changes: 21 additions & 0 deletions .octocov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
coverage:
acceptable: current >= 89%
codeToTestRatio:
code:
- '**/*.go'
- '!**/*_test.go'
test:
- '**/*_test.go'
diff:
datastores:
- artifact://${GITHUB_REPOSITORY}
push:
if: is_default_branch
comment:
if: is_pull_request
summary:
if: true
report:
if: is_default_branch
datastores:
- artifact://${GITHUB_REPOSITORY}
Loading