Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py authored Jul 10, 2024
2 parents 0d1efc3 + a7aec6d commit ef7b1ed
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
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 }}
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

0 comments on commit ef7b1ed

Please sign in to comment.