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: add configurable coverage for django #56

Merged
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
7 changes: 6 additions & 1 deletion .github/workflows/django-step-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ on:
type: string
default: ""

COVERAGE_THRESHOLD:
required: false
type: number
default: 50

env: "${{secrets}}"

jobs:
Expand Down Expand Up @@ -84,7 +89,7 @@ jobs:
coverage erase
coverage run --source='.' manage.py test --noinput
coverage xml -i -o coverage-reports/coverage-django.xml
coverage report --fail-under 50
coverage report --fail-under ${{ inputs.COVERAGE_THRESHOLD }}

- name: Archive code coverage results
uses: actions/upload-artifact@v3
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/django-workflow-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ on:
required: false
type: string
default: ""
COVERAGE_THRESHOLD:
required: false
type: number
default: 50

jobs:
django-lint-check:
uses:
Expand Down Expand Up @@ -69,4 +74,5 @@ jobs:
SETUP_COMMANDS: ${{ inputs.SETUP_COMMANDS }}
ENABLE_LFS: ${{inputs.ENABLE_LFS}}
LFS_REPO_PATH: ${{inputs.LFS_REPO_PATH}}
COVERAGE_THRESHOLD: ${{inputs.COVERAGE_THRESHOLD}}
secrets: inherit
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ In addition, it is possible to specify this optional input:
- **SETUP_COMMANDS**: Allow to execute commands before the download of the dependencies. Useful to install packages required for Python dependencies.
- **ENABLE_LFS**: To enable Git LFS support on checkout
- **LFS_REPO_PATH**: Required when ENABLE_LFS is true. Workaround for https://github.com/actions/checkout/issues/1169. Set to "/__w/repo-name/repo-name"
- **COVERAGE_THRESHOLD**: The minimal code coverage for this project. If the coverage is lower than this value, the workflow will fail. By default, it is **50**.

This is an example to show how data should be formatted.

Expand Down