diff --git a/.github/workflows/ci_template.yml b/.github/workflows/ci_template.yml index f9e87d29..9618ea42 100644 --- a/.github/workflows/ci_template.yml +++ b/.github/workflows/ci_template.yml @@ -25,7 +25,17 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: pip install .[dev] + - name: Run tests - run: pytest \ No newline at end of file + run: pytest + + - name: Upload coverage to Codecov + if: success() && (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10') + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true \ No newline at end of file diff --git a/README.md b/README.md index 9379f692..e54b3333 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # SWMManywhere: Synthesise Urban Drainage Network Models Anywhere in the World +[![PyPI version shields.io](https://img.shields.io/pypi/v/swmmanywhere.svg)](https://pypi.python.org/pypi/swmmanywhere/) [![Test and build](https://github.com/ImperialCollegeLondon/SWMManywhere/actions/workflows/ci.yml/badge.svg)](https://github.com/ImperialCollegeLondon/SWMManywhere/actions/workflows/ci.yml) [![DOI](https://zenodo.org/badge/741903266.svg)](https://zenodo.org/doi/10.5281/zenodo.13837741) +[![codecov](https://codecov.io/gh/ImperialCollegeLondon/SWMManywhere/graph/badge.svg)](https://codecov.io/gh/ImperialCollegeLondon/SWMManywhere) SWMManywhere is a tool to synthesise urban drainage network models (UDMs) using diff --git a/mkdocs.yml b/mkdocs.yml index c561e5fd..7d02f737 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,9 +17,6 @@ plugins: - mkdocs-jupyter: execute: false - search - - coverage: - page_name: coverage # default - html_report_dir: htmlcov # default - include-markdown repo_url: https://github.com/ImperialCollegeLondon/SWMManywhere @@ -61,4 +58,4 @@ nav: - Post processing: reference-post-processing.md - Preprocessing: reference-preprocessing.md - Config definitions: reference-defs.md - - Coverage report: coverage.md \ No newline at end of file + - Coverage report: https://app.codecov.io/gh/ImperialCollegeLondon/SWMManywhere \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 66ca600e..9d950f89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,6 @@ optional-dependencies.dev = [ ] optional-dependencies.doc = [ "mkdocs", - "mkdocs-coverage", "mkdocs-include-markdown-plugin", "mkdocs-jupyter", "mkdocs-material", @@ -110,7 +109,7 @@ skip = "src/swmmanywhere/defs/iso_converter.yml,*.inp" ignore-words-list = "gage,gages" [tool.pytest.ini_options] -addopts = "-v --cov=src/swmmanywhere --cov-report=html --doctest-modules --ignore=src/swmmanywhere/logging.py" +addopts = "-v --cov=src/swmmanywhere --cov-report=xml --doctest-modules --ignore=src/swmmanywhere/logging.py" markers = [ "downloads: mark a test as requiring downloads", ]