From 4352b567c6ef77cdcdc0874c989fb24ddf8fa599 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 3 Apr 2024 16:15:22 -0600 Subject: [PATCH 01/13] Adding code coverage workflow --- .github/workflows/coverage.yaml | 27 +++++++++++++++++++++++++++ .github/workflows/test_model.yaml | 13 ++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 00000000..3e3a41b3 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,27 @@ +name: Coverage + +on: + workflow_run: + workflows: ["installation and testing model"] + types: + - completed + +jobs: + upload: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + # Retrieve artifacts (coverage from the CI) + - name: Download coverage + uses: actions/download-artifact@v2 + with: + name: coverage + path: coverage + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: CDCgov/multisignal-epi-inference diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml index f849b20a..b701651e 100755 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/test_model.yaml @@ -10,9 +10,11 @@ jobs: 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: @@ -20,7 +22,16 @@ jobs: 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 + run: poetry run -C model pytest model --cov=model + + # Upload artifacts + - name: Upload coverage report + uses: actions/upload-artifact@v2 + with: + name: coverage + path: model/.coverage From b8e3248e629cb38fdb9cfa9c7fb781168eb0cd14 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 3 Apr 2024 16:30:07 -0600 Subject: [PATCH 02/13] Coverage is in the same test file --- .github/workflows/coverage.yaml | 27 --------------------------- .github/workflows/test_model.yaml | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml deleted file mode 100644 index 3e3a41b3..00000000 --- a/.github/workflows/coverage.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Coverage - -on: - workflow_run: - workflows: ["installation and testing model"] - types: - - completed - -jobs: - upload: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - # Retrieve artifacts (coverage from the CI) - - name: Download coverage - uses: actions/download-artifact@v2 - with: - name: coverage - path: coverage - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - slug: CDCgov/multisignal-epi-inference diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml index b701651e..78d26299 100755 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/test_model.yaml @@ -26,12 +26,19 @@ jobs: - name: install package run: poetry install -C model + - name: install pytest-cov + run: poetry run pip install pytest-cov + - name: run tests - run: poetry run -C model pytest model --cov=model + run: poetry run -C model pytest model --cov=./ - # Upload artifacts - - name: Upload coverage report - uses: actions/upload-artifact@v2 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 with: - name: coverage - path: model/.coverage + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: true + files: .coverage1 + flags: unittests + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true From 05c26766b69f0d44e547ec5767c6511f1d4768ea Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 3 Apr 2024 16:31:44 -0600 Subject: [PATCH 03/13] Update test_model.yaml --- .github/workflows/test_model.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml index 78d26299..0205ba52 100755 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/test_model.yaml @@ -27,7 +27,7 @@ jobs: run: poetry install -C model - name: install pytest-cov - run: poetry run pip install pytest-cov + run: poetry run -C model pip install pytest-cov - name: run tests run: poetry run -C model pytest model --cov=./ From aa77d150f33bcb8a314a3de4049931a7f8bdc244 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 3 Apr 2024 16:34:39 -0600 Subject: [PATCH 04/13] Correcting upload path --- .github/workflows/test_model.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml index 0205ba52..8bd1cd6f 100755 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/test_model.yaml @@ -30,15 +30,15 @@ jobs: run: poetry run -C model pip install pytest-cov - name: run tests - run: poetry run -C model pytest model --cov=./ + run: poetry run -C model pytest model --cov=pyrenew - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: - directory: ./coverage/reports/ + directory: . env_vars: OS,PYTHON fail_ci_if_error: true - files: .coverage1 + files: .coverage flags: unittests token: ${{ secrets.CODECOV_TOKEN }} verbose: true From 9e2823ab70c0bec71a209d3f05231d290b348472 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 3 Apr 2024 16:51:33 -0600 Subject: [PATCH 05/13] Trying to upload the right thing codecov --- .github/workflows/test_model.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml index 8bd1cd6f..ccf594f3 100755 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/test_model.yaml @@ -38,7 +38,8 @@ jobs: directory: . env_vars: OS,PYTHON fail_ci_if_error: true - files: .coverage + file: .coverage flags: unittests + plugin: pycoverage token: ${{ secrets.CODECOV_TOKEN }} verbose: true From 3f48595a027e2f7618b906a8617b4d76df94c600 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 3 Apr 2024 17:00:39 -0600 Subject: [PATCH 06/13] Trying to upload the right thing codecov --- .github/workflows/test_model.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml index ccf594f3..aba04f07 100755 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/test_model.yaml @@ -38,7 +38,6 @@ jobs: directory: . env_vars: OS,PYTHON fail_ci_if_error: true - file: .coverage flags: unittests plugin: pycoverage token: ${{ secrets.CODECOV_TOKEN }} From 5ef4b96e1e3ec57d349392bf128240aa6cd7596d Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 3 Apr 2024 17:00:54 -0600 Subject: [PATCH 07/13] Trying to upload the right thing codecov --- .github/workflows/test_model.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml index aba04f07..92a3924a 100755 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/test_model.yaml @@ -35,7 +35,6 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: - directory: . env_vars: OS,PYTHON fail_ci_if_error: true flags: unittests From a13071b5266034d8ce5193cb4e11a7dbb65bf235 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 4 Apr 2024 09:12:17 -0600 Subject: [PATCH 08/13] Output to term and xml --- .github/workflows/test_model.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_model.yaml b/.github/workflows/test_model.yaml index 92a3924a..0b1d0e6f 100755 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/test_model.yaml @@ -30,7 +30,9 @@ jobs: run: poetry run -C model pip install pytest-cov - name: run tests - run: poetry run -C model pytest model --cov=pyrenew + 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 @@ -38,6 +40,7 @@ jobs: env_vars: OS,PYTHON fail_ci_if_error: true flags: unittests + file: coverage.xml plugin: pycoverage token: ${{ secrets.CODECOV_TOKEN }} verbose: true From 1fdff74f52f38022099499f2388922df415078ab Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 4 Apr 2024 09:28:23 -0600 Subject: [PATCH 09/13] Adding coverage badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0be64ea3..919ef624 100755 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![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) +[![codecov](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. From ad54c9873d16f09482267c19b7d6bf0fa03618b5 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 4 Apr 2024 09:36:57 -0600 Subject: [PATCH 10/13] Shortening workflow names (shorter badges) --- .github/workflows/{test_model.yaml => model.yaml} | 2 +- .github/workflows/{test_pipeline.yaml => pipeline.yaml} | 2 +- .github/workflows/{sphinx.yaml => website.yaml} | 0 README.md | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{test_model.yaml => model.yaml} (96%) mode change 100755 => 100644 rename .github/workflows/{test_pipeline.yaml => pipeline.yaml} (93%) mode change 100755 => 100644 rename .github/workflows/{sphinx.yaml => website.yaml} (100%) diff --git a/.github/workflows/test_model.yaml b/.github/workflows/model.yaml old mode 100755 new mode 100644 similarity index 96% rename from .github/workflows/test_model.yaml rename to .github/workflows/model.yaml index 0b1d0e6f..b735a3d4 --- a/.github/workflows/test_model.yaml +++ b/.github/workflows/model.yaml @@ -1,4 +1,4 @@ -name: installation and testing model +name: model on: pull_request: diff --git a/.github/workflows/test_pipeline.yaml b/.github/workflows/pipeline.yaml old mode 100755 new mode 100644 similarity index 93% rename from .github/workflows/test_pipeline.yaml rename to .github/workflows/pipeline.yaml index c195c936..bcd3287c --- a/.github/workflows/test_pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -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 100% rename from .github/workflows/sphinx.yaml rename to .github/workflows/website.yaml diff --git a/README.md b/README.md index 919ef624..421e2d1b 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![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) -[![codecov](https://codecov.io/gh/CDCgov/multisignal-epi-inference/graph/badge.svg?token=7Z06HOMYR1)](https://codecov.io/gh/CDCgov/multisignal-epi-inference) +[![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. From adced5adff9c6c8e09cfe4d6ee2fb9753c24da82 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 4 Apr 2024 09:39:23 -0600 Subject: [PATCH 11/13] README points to the rigth badges --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 421e2d1b..ff18b029 100755 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ ⚠️ 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. From d1210475b3eae47c45ae857977b2e33a00e8a70f Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 4 Apr 2024 09:45:13 -0600 Subject: [PATCH 12/13] Missed name of website [skip ci] --- .github/workflows/website.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index c5f16946..d6bdc36a 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -1,4 +1,4 @@ -name: "Sphinx: Render docs" +name: website on: push: From 55d2294a2ef0d37c17bfcc938fcca32b5e8ebb0e Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 4 Apr 2024 10:10:28 -0600 Subject: [PATCH 13/13] Reverting name changes in workflows --- .github/workflows/{model.yaml => test_model.yml} | 0 .github/workflows/{pipeline.yaml => test_pipeline.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{model.yaml => test_model.yml} (100%) rename .github/workflows/{pipeline.yaml => test_pipeline.yml} (100%) diff --git a/.github/workflows/model.yaml b/.github/workflows/test_model.yml similarity index 100% rename from .github/workflows/model.yaml rename to .github/workflows/test_model.yml diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/test_pipeline.yml similarity index 100% rename from .github/workflows/pipeline.yaml rename to .github/workflows/test_pipeline.yml