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 CodeCov workflow #19

Merged
merged 6 commits into from
Jul 10, 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
10 changes: 10 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
codecov:
token: ${{ secrets.CODECOV_TOKEN }}
ci:
- "test_on_push"
strict_yaml_branch: "main"
disable_default_path_fixes: no
require_ci_to_pass: yes

github_checks:
annotations: true
11 changes: 11 additions & 0 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
push:
branches:
- main

jobs:
style:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,3 +53,13 @@ jobs:
- name: Test Template Generation
run: |
nox -s test-generation

- name: Run coverage tests
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: python -m nox -s coverage

- name: Upload coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
arjxn-py marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ def run_template_generation(session):
session.install("-e", ".[dev]", silent=False)
session.run("pytest", "tests")

@nox.session(name="coverage")
def run_coverage(session):
"""Run the coverage tests and generate an XML report."""
session.install("setuptools", silent=False)
session.install("coverage", silent=False)
session.install("-e", ".[all,dev,jax]", silent=False)
session.run("pytest", "--cov=src/pybamm_cookiecutter", "--cov-report=xml", "tests/")

@nox.session(name="dev")
def set_dev(session):
"""Install pybamm-cookiecutter in editable mode"""
Expand Down
Loading