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

feat: add code coverage to sanctions #27

Merged
merged 3 commits into from
Nov 21, 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
10 changes: 7 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
branch = True
data_file = .coverage
source=sanctions
relative_files = True
omit =
CODEOWNERS
sanctions/settings/*
sanctions/conf/*
*wsgi.py
*/migrations/*
*migrations*
*admin.py
*/static/*
*/templates/*
*static*
*templates*
*test*
*gunicorn_configuration.py
23 changes: 17 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ jobs:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: ["py38", "quality", "docs", "pii_check"]
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write

steps:
- uses: actions/checkout@v3
Expand All @@ -36,9 +44,12 @@ jobs:
TOXENV: ${{ matrix.toxenv }}
run: tox

# - name: Run coverage
# if: matrix.python-version == '3.8' && matrix.toxenv == 'py38'
# uses: codecov/codecov-action@v3
# with:
# flags: unittests
# fail_ci_if_error: true
- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38'
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
MINIMUM_GREEN: 90
MINIMUM_ORANGE: 80
ANNOTATE_MISSING_LINES: true
ANNOTATION_TYPE: error
12 changes: 0 additions & 12 deletions codecov.yml

This file was deleted.

1 change: 1 addition & 0 deletions requirements/ci.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

tox # Virtualenv management for tests
tox-battery # Makes tox aware of requirements file changes
coverage
16 changes: 12 additions & 4 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,35 @@
#
# make upgrade
#
coverage==7.3.2
# via -r requirements/ci.in
distlib==0.3.7
# via virtualenv
filelock==3.13.1
# via
# tox
# virtualenv
packaging==23.2
# via tox
# via
# pyproject-api
# tox
platformdirs==3.11.0
# via virtualenv
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# tox
# virtualenv
pluggy==1.3.0
# via tox
py==1.11.0
# via tox
six==1.16.0
# via tox
tomli==2.0.1
# via tox
# via
# pyproject-api
# tox
tox==3.28.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/ci.in
# tox-battery
tox-battery==0.6.2
Expand Down
Loading