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

added cicd for codecov in an enhanced way #24

Merged
merged 2 commits into from
Apr 27, 2024
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
38 changes: 38 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ignore:
- "tests/*"
- "PQAnalysis/_version.py"

coverage:
status:
project:
relative_coverage:
# basic
target: auto #default
base: auto
if_ci_failed: error #success, failure, error, ignore
carryforward:
target: auto #default
base: auto
flags:
- new_code
if_ci_failed: error #success, failure, error, ignore
informational: false
only_pulls: false

github_checks:
annotations: true

comment:
layout: "newheader, diff, flags, files"
require_changes: false # if true: only post the comment if coverage changes
require_base: false # [yes :: must have a base report to post]
require_head: true # [yes :: must have a head report to post]
show_carryforward_flags: true
show_critical_paths: true #new option to labeled critical files
hide_comment_details: true #collapse all the "detailed info" for the PR comment

flags:
new_code:
paths:
- "PQAnalysis"
carryforward: true
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: CI
name: Test Coverage

on:
push:
branches: [main]
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:

jobs:
Expand All @@ -12,19 +16,17 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: 3.x

- name: build PQAnalysis
run: |
pip install .[test]

- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
python -m pytest --cov=PQAnalysis --cov-report=xml
python -m pytest

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docstr.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CI
name: Docstring Coverage

on:
push:
branches: [dev, main]
pull_request:
branches: [dev, main]
branches: ['*']
workflow_dispatch:

env:
Expand Down
3 changes: 0 additions & 3 deletions codecov.yml

This file was deleted.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ test = [
"pytest-cov",
"pylint",
"pylint-django",
"docstr-coverage",
]
docs = [
"sphinx",
Expand Down
Loading