From ca96421a35995c183d120da62e550116a7a32331 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 4 Apr 2024 10:39:09 -0600 Subject: [PATCH] Adding code coverage workflow (#64) --- .github/workflows/test_model.yaml | 26 ----------- .github/workflows/test_model.yml | 46 +++++++++++++++++++ .../{test_pipeline.yaml => test_pipeline.yml} | 2 +- .../workflows/{sphinx.yaml => website.yaml} | 2 +- README.md | 7 +-- 5 files changed, 52 insertions(+), 31 deletions(-) delete mode 100755 .github/workflows/test_model.yaml create mode 100644 .github/workflows/test_model.yml rename .github/workflows/{test_pipeline.yaml => test_pipeline.yml} (93%) mode change 100755 => 100644 rename .github/workflows/{sphinx.yaml => website.yaml} (98%) diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml deleted file mode 100755 index f849b20a..00000000 --- a/.github/workflows/test_model.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: installation and testing model - -on: - pull_request: - push: - branches: [main] - -jobs: - install-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: cache poetry - uses: actions/cache@v4 - with: - path: ~/.local - key: ${{ runner.os }}-poetry - - name: install poetry - run: pip install poetry - - name: install package - run: poetry install -C model - - name: run tests - run: poetry run -C model pytest model diff --git a/.github/workflows/test_model.yml b/.github/workflows/test_model.yml new file mode 100644 index 00000000..b735a3d4 --- /dev/null +++ b/.github/workflows/test_model.yml @@ -0,0 +1,46 @@ +name: model + +on: + pull_request: + push: + branches: [main] + +jobs: + install-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: cache poetry + uses: actions/cache@v4 + with: + path: ~/.local + key: ${{ runner.os }}-poetry + - name: install poetry + run: pip install poetry + + - name: install package + run: poetry install -C model + + - name: install pytest-cov + run: poetry run -C model pip install pytest-cov + + - name: run tests + run: | + poetry run -C model pytest \ + --cov=pyrenew --cov-report term --cov-report xml model + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + env_vars: OS,PYTHON + fail_ci_if_error: true + flags: unittests + file: coverage.xml + plugin: pycoverage + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.github/workflows/test_pipeline.yaml b/.github/workflows/test_pipeline.yml old mode 100755 new mode 100644 similarity index 93% rename from .github/workflows/test_pipeline.yaml rename to .github/workflows/test_pipeline.yml index c195c936..bcd3287c --- a/.github/workflows/test_pipeline.yaml +++ b/.github/workflows/test_pipeline.yml @@ -1,4 +1,4 @@ -name: installation and testing pipeline +name: pipeline on: pull_request: diff --git a/.github/workflows/sphinx.yaml b/.github/workflows/website.yaml similarity index 98% rename from .github/workflows/sphinx.yaml rename to .github/workflows/website.yaml index c5f16946..d6bdc36a 100644 --- a/.github/workflows/sphinx.yaml +++ b/.github/workflows/website.yaml @@ -1,4 +1,4 @@ -name: "Sphinx: Render docs" +name: website on: push: diff --git a/README.md b/README.md index 0be64ea3..ff18b029 100755 --- a/README.md +++ b/README.md @@ -3,9 +3,10 @@ ⚠️ This is a work in progress ⚠️ [![Pre-commit](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/pre-commit.yaml/badge.svg)](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/pre-commit.yaml) -[![installation and testing model](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/test_model.yaml/badge.svg)](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/test_model.yaml) -[![installation and testing pipeline](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/test_pipeline.yaml/badge.svg)](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/test_pipeline.yaml) -[![Docs: model](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/sphinx.yaml/badge.svg)](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/sphinx.yaml) +[![installation and testing model](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/model.yaml/badge.svg)](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/model.yaml) +[![installation and testing pipeline](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/pipeline.yaml/badge.svg)](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/pipeline.yaml) +[![Docs: model](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/website.yaml/badge.svg)](https://github.com/CDCgov/multisignal-epi-inference/actions/workflows/website.yaml) +[![codecov (model)](https://codecov.io/gh/CDCgov/multisignal-epi-inference/graph/badge.svg?token=7Z06HOMYR1)](https://codecov.io/gh/CDCgov/multisignal-epi-inference) This repo hosts the multisignal (*a.k.a.* signal fusion) renewal project: an internal forecasting model that leverages multiple data sources for enhancing epidemiological modeling of infectious disease outbreaks.