From 9a71776d68ef168e0e8375b46ee66498cd748f43 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:25:32 -0400 Subject: [PATCH 01/39] Split `ci.yml` into separate actions Split the "unit-tests" action into multiple actions, currently one for each package contained within the `flepiMoP` repo. Also updated checkout from v3 to v4 to address node16 deprecation warnings and swapped ubuntu 20.04 for ubuntu latest. Changed the gempyor ci to not print stdout and exit on first failure. --- .github/workflows/ci.yml | 70 ---------------------------- .github/workflows/flepicommon-ci.yml | 40 ++++++++++++++++ .github/workflows/gempyor-ci.yml | 45 ++++++++++++++++++ .github/workflows/inference-ci.yml | 40 ++++++++++++++++ 4 files changed, 125 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/flepicommon-ci.yml create mode 100644 .github/workflows/gempyor-ci.yml create mode 100644 .github/workflows/inference-ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 29e9a186d..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: unit-tests - -on: - workflow_dispatch: - push: - branches: - - main - - dev - pull_request: - branches: - - main - - dev - - breaking-improvments - -jobs: - unit-tests: - runs-on: ubuntu-20.04 - container: - image: hopkinsidd/flepimop:latest-dev - options: --user root - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - lfs: true - - name: Set up Rprofile - run: | - cp build/docker/Docker.Rprofile $HOME/.Rprofile - cp /home/app/.bashrc $HOME/.bashrc - shell: bash - - name: Install the gempyor package - run: | - source /var/python/3.10/virtualenv/bin/activate - python -m pip install --upgrade pip - python -m pip install "flepimop/gempyor_pkg[test]" - shell: bash - - name: Install local R packages - run: Rscript build/local_install.R - shell: bash - - name: Run gempyor tests - run: | - source /var/python/3.10/virtualenv/bin/activate - cd flepimop/gempyor_pkg - pytest -s - shell: bash - - name: Run gempyor-cli integration tests from examples - run: | - source /var/python/3.10/virtualenv/bin/activate - cd examples - pytest -s - shell: bash - - name: Run flepicommon tests - run: | - setwd("flepimop/R_packages/flepicommon") - devtools::test(stop_on_failure=TRUE) - shell: Rscript {0} - - name: Run inference tests - run: | - setwd("flepimop/R_packages/inference") - devtools::test(stop_on_failure=TRUE) - shell: Rscript {0} -# - name: Run integration tests -# env: -# CENSUS_API_KEY: ${{ secrets.CENSUS_API_KEY }} -# run: | -# Rscript build/local_install.R -# cd test -# source /var/python/3.10/virtualenv/bin/activate -# pytest run_tests.py -# shell: bash diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml new file mode 100644 index 000000000..b7c0cc5f3 --- /dev/null +++ b/.github/workflows/flepicommon-ci.yml @@ -0,0 +1,40 @@ +name: flepicommon-ci + +on: + workflow_dispatch: + push: + paths: + - flepimop/R_packages/flepicommon/**/* + branches: + - main + - dev + pull_request: + branches: + - main + - dev + - breaking-improvements + +jobs: + unit-tests: + runs-on: ubuntu-latest + container: + image: hopkinsidd/flepimop:latest-dev + options: --user root + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + - name: Set up Rprofile + run: | + cp build/docker/Docker.Rprofile $HOME/.Rprofile + cp /home/app/.bashrc $HOME/.bashrc + shell: bash + - name: Install local R packages + run: Rscript build/local_install.R + shell: bash + - name: Run flepicommon tests + run: | + setwd("flepimop/R_packages/flepicommon") + devtools::test(stop_on_failure=TRUE) + shell: Rscript {0} diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml new file mode 100644 index 000000000..d9c9b1133 --- /dev/null +++ b/.github/workflows/gempyor-ci.yml @@ -0,0 +1,45 @@ +name: gempyor-ci + +on: + workflow_dispatch: + push: + paths: + - examples/**/* + - flepimop/gempyor_pkg/**/* + branches: + - main + - dev + pull_request: + branches: + - main + - dev + - breaking-improvements + +jobs: + unit-tests: + runs-on: ubuntu-latest + container: + image: hopkinsidd/flepimop:latest-dev + options: --user root + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + - name: Install the gempyor package + run: | + source /var/python/3.10/virtualenv/bin/activate + python -m pip install --upgrade pip + python -m pip install "flepimop/gempyor_pkg[test]" + shell: bash + - name: Run gempyor tests + run: | + source /var/python/3.10/virtualenv/bin/activate + cd flepimop/gempyor_pkg + pytest --exitfirst + shell: bash + - name: Run gempyor-cli integration tests from examples + run: | + source /var/python/3.10/virtualenv/bin/activate + cd examples + pytest --exitfirst diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml new file mode 100644 index 000000000..f04e34594 --- /dev/null +++ b/.github/workflows/inference-ci.yml @@ -0,0 +1,40 @@ +name: inference-ci + +on: + workflow_dispatch: + push: + paths: + - flepimop/R_packages/inference/**/* + branches: + - main + - dev + pull_request: + branches: + - main + - dev + - breaking-improvements + +jobs: + unit-tests: + runs-on: ubuntu-latest + container: + image: hopkinsidd/flepimop:latest-dev + options: --user root + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + - name: Set up Rprofile + run: | + cp build/docker/Docker.Rprofile $HOME/.Rprofile + cp /home/app/.bashrc $HOME/.bashrc + shell: bash + - name: Install local R packages + run: Rscript build/local_install.R + shell: bash + - name: Run inference tests + run: | + setwd("inference/R_packages/inference") + devtools::test(stop_on_failure=TRUE) + shell: Rscript {0} From e3adcbab3416a4aaf98fc24eb63564f78d8f4a1b Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:44:43 -0400 Subject: [PATCH 02/39] Correct working dir in `inference-ci.yml` Typo in `setwd` call causes error about not being able to change to directory that doesn't exist. --- .github/workflows/inference-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index f04e34594..ed6698dde 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -35,6 +35,6 @@ jobs: shell: bash - name: Run inference tests run: | - setwd("inference/R_packages/inference") + setwd("flepimop/R_packages/inference") devtools::test(stop_on_failure=TRUE) shell: Rscript {0} From 240b25773a1205400e836811df9cbe7a84a286c3 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:52:17 -0400 Subject: [PATCH 03/39] Set `gempyor` integration tests shell Set the shell to bash so the `source` function is available. --- .github/workflows/gempyor-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index d9c9b1133..ce26a5750 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -43,3 +43,4 @@ jobs: source /var/python/3.10/virtualenv/bin/activate cd examples pytest --exitfirst + shell: bash From e49109acdd6cfa99fdadaa260c34bfaee6bd6ea9 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:58:29 -0400 Subject: [PATCH 04/39] Limit paths for PRs in actions Add the same path related limits from the on push to on pull_requests as well. --- .github/workflows/flepicommon-ci.yml | 2 ++ .github/workflows/gempyor-ci.yml | 3 +++ .github/workflows/inference-ci.yml | 2 ++ 3 files changed, 7 insertions(+) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index b7c0cc5f3..da1f07ba6 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -9,6 +9,8 @@ on: - main - dev pull_request: + paths: + - flepimop/R_packages/flepicommon/**/* branches: - main - dev diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index ce26a5750..4f93d7250 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -10,6 +10,9 @@ on: - main - dev pull_request: + paths: + - examples/**/* + - flepimop/gempyor_pkg/**/* branches: - main - dev diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index ed6698dde..c708b8a4b 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -9,6 +9,8 @@ on: - main - dev pull_request: + paths: + - flepimop/R_packages/inference/**/* branches: - main - dev From 49475afa8627b49adf5fe36275b2aaf34d11fc4d Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:07:29 -0400 Subject: [PATCH 05/39] Remove 'breaking-improvements' branch Removed the `breaking-improvements` branch from special consideration in GitHub actions. --- .github/workflows/flepicommon-ci.yml | 1 - .github/workflows/gempyor-ci.yml | 1 - .github/workflows/inference-ci.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index da1f07ba6..5314c1b4f 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -14,7 +14,6 @@ on: branches: - main - dev - - breaking-improvements jobs: unit-tests: diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index 4f93d7250..a2cb6e313 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -16,7 +16,6 @@ on: branches: - main - dev - - breaking-improvements jobs: unit-tests: diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index c708b8a4b..2ca3d4897 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -14,7 +14,6 @@ on: branches: - main - dev - - breaking-improvements jobs: unit-tests: From b56d2d9d039cc67f63dd0c67f215021ce6bb340a Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:07:28 -0400 Subject: [PATCH 06/39] Update gempyor action to test 3.11 and 3.10 Minor edits to run the gempyor tests with python 3.10 and 3.11. Remove usage of custom docker container. --- .github/workflows/gempyor-ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index a2cb6e313..d3e968b8a 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -20,29 +20,30 @@ on: jobs: unit-tests: runs-on: ubuntu-latest - container: - image: hopkinsidd/flepimop:latest-dev - options: --user root + strategy: + matrix: + python-version: ["3.10", "3.11"] steps: - name: Checkout uses: actions/checkout@v4 with: lfs: true - - name: Install the gempyor package + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install gempyor run: | - source /var/python/3.10/virtualenv/bin/activate python -m pip install --upgrade pip - python -m pip install "flepimop/gempyor_pkg[test]" + python -m pip install "flepimop/gempyor_pkg[dev]" shell: bash - name: Run gempyor tests run: | - source /var/python/3.10/virtualenv/bin/activate cd flepimop/gempyor_pkg pytest --exitfirst shell: bash - name: Run gempyor-cli integration tests from examples run: | - source /var/python/3.10/virtualenv/bin/activate cd examples pytest --exitfirst shell: bash From ea3ebc6816babcfa04619112ee2b79843edfce00 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:22:44 -0400 Subject: [PATCH 07/39] Delete line to trigger GH Action Very minor edit to `__init__.py` to trigger the `gempyor` CI GitHub action. --- flepimop/gempyor_pkg/src/gempyor/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flepimop/gempyor_pkg/src/gempyor/__init__.py b/flepimop/gempyor_pkg/src/gempyor/__init__.py index 432754c6c..bdf56083b 100644 --- a/flepimop/gempyor_pkg/src/gempyor/__init__.py +++ b/flepimop/gempyor_pkg/src/gempyor/__init__.py @@ -1,4 +1,3 @@ ## All functions are in minimal inference. - from .inference import * from .utils import * From 3d087c7a0ec4949daa7c2bb704e0d4cac09c8f34 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:27:04 -0400 Subject: [PATCH 08/39] Correct extra install name Need to install `test` extra installs to get pytest instead of `dev`. --- .github/workflows/gempyor-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index d3e968b8a..5f495ebed 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -35,7 +35,7 @@ jobs: - name: Install gempyor run: | python -m pip install --upgrade pip - python -m pip install "flepimop/gempyor_pkg[dev]" + python -m pip install "flepimop/gempyor_pkg[test]" shell: bash - name: Run gempyor tests run: | From 516909aa0b21206cc68aa9cfc21752f2277a7ba7 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:46:05 -0400 Subject: [PATCH 09/39] Add dependency in GitHub workflows `inference-ci` now triggers whenever `flepicommon-ci` or `gempyor-ci` runs. --- .github/workflows/flepicommon-ci.yml | 2 +- .github/workflows/gempyor-ci.yml | 2 +- .github/workflows/inference-ci.yml | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 5314c1b4f..813a4b35c 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -16,7 +16,7 @@ on: - dev jobs: - unit-tests: + ci: runs-on: ubuntu-latest container: image: hopkinsidd/flepimop:latest-dev diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index 5f495ebed..86b4645a3 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -18,7 +18,7 @@ on: - dev jobs: - unit-tests: + ci: runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 2ca3d4897..4bb2a5b8b 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -2,6 +2,10 @@ name: inference-ci on: workflow_dispatch: + workflow_run: + workflows: ['flepicommon-ci', 'gempyor-ci'] + types: + - completed push: paths: - flepimop/R_packages/inference/**/* @@ -16,8 +20,9 @@ on: - dev jobs: - unit-tests: + ci: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} container: image: hopkinsidd/flepimop:latest-dev options: --user root From 4b9d019fb87f2e3539c75d126a8d2a798319fe4b Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 07:54:47 -0400 Subject: [PATCH 10/39] Remove custom docker from flepicommon CI Also move to using standard GitHub actions to simplify the workflow. --- .github/workflows/flepicommon-ci.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 813a4b35c..04c76ddce 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -18,24 +18,24 @@ on: jobs: ci: runs-on: ubuntu-latest - container: - image: hopkinsidd/flepimop:latest-dev - options: --user root + strategy: + matrix: + R-version: ["4.3.3"] steps: - name: Checkout uses: actions/checkout@v4 with: lfs: true - - name: Set up Rprofile - run: | - cp build/docker/Docker.Rprofile $HOME/.Rprofile - cp /home/app/.bashrc $HOME/.bashrc - shell: bash - - name: Install local R packages - run: Rscript build/local_install.R - shell: bash - - name: Run flepicommon tests + - name: Setup R ${{ matrix.R-version }} + uses: r-lib/actions/setup-r@v2 + - name: Install Dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::devtools + working-directory: 'flepimop/R_packages/flepicommon' + - name: Run Unit Tests run: | + library(devtools) setwd("flepimop/R_packages/flepicommon") devtools::test(stop_on_failure=TRUE) shell: Rscript {0} From 07d93cdf8b3a540a04c01e225c95235f827813d6 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 07:56:51 -0400 Subject: [PATCH 11/39] Add empty space to invoke flepicommon CI --- flepimop/R_packages/flepicommon/R/config.R | 1 + 1 file changed, 1 insertion(+) diff --git a/flepimop/R_packages/flepicommon/R/config.R b/flepimop/R_packages/flepicommon/R/config.R index 6f65ff562..e4e2dd91d 100644 --- a/flepimop/R_packages/flepicommon/R/config.R +++ b/flepimop/R_packages/flepicommon/R/config.R @@ -159,6 +159,7 @@ check_within_bounds <- function(value, obj) { } } + #' @name prettyprint_optlist #' @description Print a list of options such that it does not take the whole screen #' Display `name : value` \n for all elements. From bd91d7bd79963b0a60851cbd5ac850b9810725bf Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 09:18:14 -0400 Subject: [PATCH 12/39] Attempt to speed up flepicommon CI Test run at speeding up the flepicommon CI compared to using the default r-lib/actions by doing only the required work for tests manually. --- .github/workflows/flepicommon-ci.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 04c76ddce..5dc00117e 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -28,14 +28,27 @@ jobs: lfs: true - name: Setup R ${{ matrix.R-version }} uses: r-lib/actions/setup-r@v2 - - name: Install Dependencies - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::devtools - working-directory: 'flepimop/R_packages/flepicommon' + r-version: ${{ matrix.R-version }} + - name: Build flepicommon + run: | + R CMD build flepimop/R_packages/flepicommon/ + shell: bash + - name: Install Dependencies + run: | + files <- list.files() + pkg <- files[startsWith(files, "flepicommon_")] + install.packages(pkg, dependencies=TRUE) + install.packages("testthat") + shell: Rscript {0} + - name: Install flepicommon + run: | + TAR_GZ=$( find . -maxdepth 1 -regex ".*flepicommon.*" -printf "%P\n" ) + DEST=$( R -s -e "cat(.libPaths()[1L])" | xargs ) + R CMD install $TAR_GZ $DEST - name: Run Unit Tests run: | - library(devtools) - setwd("flepimop/R_packages/flepicommon") - devtools::test(stop_on_failure=TRUE) + library(flepicommon) + library(testthat) + test_local("flepimop/R_packages/flepicommon") shell: Rscript {0} From 132ba536e7b7897ac6f2be2b65558175e4e9917e Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:17:08 -0400 Subject: [PATCH 13/39] Install `flepicommon` with `install.packages` Having lots of trouble getting `R CMD install` to work in a GitHub action. I suspect because `r-lib/actions/setup-r` does something clever to install just R without associated tools that cause bloat. But in this cause cause problems because the version of `R CMD install` does not match `R`. --- .github/workflows/flepicommon-ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 5dc00117e..95b31bd44 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -34,18 +34,14 @@ jobs: run: | R CMD build flepimop/R_packages/flepicommon/ shell: bash - - name: Install Dependencies + - name: Install Dependencies And flepicommon run: | files <- list.files() pkg <- files[startsWith(files, "flepicommon_")] install.packages(pkg, dependencies=TRUE) install.packages("testthat") + install.packages(pkg, repos = NULL, type = "source") shell: Rscript {0} - - name: Install flepicommon - run: | - TAR_GZ=$( find . -maxdepth 1 -regex ".*flepicommon.*" -printf "%P\n" ) - DEST=$( R -s -e "cat(.libPaths()[1L])" | xargs ) - R CMD install $TAR_GZ $DEST - name: Run Unit Tests run: | library(flepicommon) From dbd692ed98fe4222b27f4745c7c76e7ead109cc4 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:24:49 -0400 Subject: [PATCH 14/39] Avoid installing `flepicommon` Now having issues with `install.packages`, an error along the lines of "ERROR: dependencies 'dplyr', 'yaml', ..., 'tidyselect' are not available for package 'flepicommon'". However, these should be installed by the `install.packages` line. --- .github/workflows/flepicommon-ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 95b31bd44..7645a0980 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -38,13 +38,13 @@ jobs: run: | files <- list.files() pkg <- files[startsWith(files, "flepicommon_")] - install.packages(pkg, dependencies=TRUE) - install.packages("testthat") - install.packages(pkg, repos = NULL, type = "source") + install.packages(pkg, dependencies = TRUE) + install.packages("devtools") + packageVersion("flepicommon") shell: Rscript {0} - name: Run Unit Tests run: | - library(flepicommon) - library(testthat) - test_local("flepimop/R_packages/flepicommon") + setwd("flepimop/R_packages/flepicommon") + library(devtools) + devtools::test(stop_on_failure = TRUE) shell: Rscript {0} From 58ab3b42ef9eacd11bde60dfd8942327bb9aff16 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:15:23 -0400 Subject: [PATCH 15/39] Install specific R from posit deb --- .github/workflows/flepicommon-ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 7645a0980..c79795724 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -26,10 +26,18 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Setup R ${{ matrix.R-version }} - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.R-version }} + - name: Install R + run: | + UBUNTU_VERSION=$( echo "$( lsb_release -r )" | awk '{print $2}' | sed 's/\.//g' ) + curl -O https://cdn.rstudio.com/r/ubuntu-${UBUNTU_VERSION}/pkgs/r-${R_VERSION}_1_amd64.deb + sudo apt-get update + sudo apt-get install ./r-${R_VERSION}_1_amd64.deb + sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R + sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript + R --version + shell: bash + env: + R_VERSION: ${{ matrix.R-version }} - name: Build flepicommon run: | R CMD build flepimop/R_packages/flepicommon/ From 9bdbbc8b69c2b7678f99003b9057d4cd251db239 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:34:41 -0400 Subject: [PATCH 16/39] Remove sudo usage --- .github/workflows/flepicommon-ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index c79795724..127603eab 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -31,10 +31,9 @@ jobs: UBUNTU_VERSION=$( echo "$( lsb_release -r )" | awk '{print $2}' | sed 's/\.//g' ) curl -O https://cdn.rstudio.com/r/ubuntu-${UBUNTU_VERSION}/pkgs/r-${R_VERSION}_1_amd64.deb sudo apt-get update - sudo apt-get install ./r-${R_VERSION}_1_amd64.deb - sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R - sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript - R --version + apt-get install ./r-${R_VERSION}_1_amd64.deb + ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R + ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript shell: bash env: R_VERSION: ${{ matrix.R-version }} @@ -42,14 +41,19 @@ jobs: run: | R CMD build flepimop/R_packages/flepicommon/ shell: bash - - name: Install Dependencies And flepicommon + - name: Install Dependencies run: | files <- list.files() pkg <- files[startsWith(files, "flepicommon_")] install.packages(pkg, dependencies = TRUE) install.packages("devtools") - packageVersion("flepicommon") shell: Rscript {0} + - name: Install flepicommon + run: | + R CMD install --help + echo "-" + TAR_GZ=$( find . -maxdepth 1 -regex ".*flepicommon.*" -printf "%P\n" ) + R CMD install $TAR_GZ - name: Run Unit Tests run: | setwd("flepimop/R_packages/flepicommon") From 7587dfd47ea2ab84e5ad5dc3781a2b320d7b0791 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:41:00 -0400 Subject: [PATCH 17/39] Debug dir permission issue. --- .github/workflows/flepicommon-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 127603eab..e2ae2e73f 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -31,9 +31,12 @@ jobs: UBUNTU_VERSION=$( echo "$( lsb_release -r )" | awk '{print $2}' | sed 's/\.//g' ) curl -O https://cdn.rstudio.com/r/ubuntu-${UBUNTU_VERSION}/pkgs/r-${R_VERSION}_1_amd64.deb sudo apt-get update - apt-get install ./r-${R_VERSION}_1_amd64.deb + sudo apt-get install ./r-${R_VERSION}_1_amd64.deb ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript + echo "-" + sudo ls -lah /opt/R/4.3.3/lib/R/library + echo "-" shell: bash env: R_VERSION: ${{ matrix.R-version }} From 651965ec6e5674f1a3bdaed5ac9213059cbc8bc4 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:42:50 -0400 Subject: [PATCH 18/39] Restore prior version of `__init__.py` Add back the white space to avoid triggering `gempyor` CI. --- flepimop/gempyor_pkg/src/gempyor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flepimop/gempyor_pkg/src/gempyor/__init__.py b/flepimop/gempyor_pkg/src/gempyor/__init__.py index bdf56083b..432754c6c 100644 --- a/flepimop/gempyor_pkg/src/gempyor/__init__.py +++ b/flepimop/gempyor_pkg/src/gempyor/__init__.py @@ -1,3 +1,4 @@ ## All functions are in minimal inference. + from .inference import * from .utils import * From e62b0548ba39d56866806b10f807cd5438cc649c Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:45:29 -0400 Subject: [PATCH 19/39] Change R library perms --- .github/workflows/flepicommon-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index e2ae2e73f..248250fd5 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -34,9 +34,7 @@ jobs: sudo apt-get install ./r-${R_VERSION}_1_amd64.deb ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript - echo "-" - sudo ls -lah /opt/R/4.3.3/lib/R/library - echo "-" + sudo chmod -R 777 /opt/R/4.3.3/lib/R/library shell: bash env: R_VERSION: ${{ matrix.R-version }} From 5b02c221dd982ee989a0d3bdb268162db3895c85 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:49:44 -0400 Subject: [PATCH 20/39] Add missing `repos` arg --- .github/workflows/flepicommon-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 248250fd5..ae4ecc0e8 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -46,7 +46,7 @@ jobs: run: | files <- list.files() pkg <- files[startsWith(files, "flepicommon_")] - install.packages(pkg, dependencies = TRUE) + install.packages(pkg, repos = "https://cloud.r-project.org", dependencies = TRUE) install.packages("devtools") shell: Rscript {0} - name: Install flepicommon From 782d677608c6d8dbe1f50d3c0c48205f93afda76 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:35:42 -0400 Subject: [PATCH 21/39] Install flepicommon with devtools, caching * Now using devtools to install the flepicommon package in the GitHub action container. * Use caching of R library to minimize repeat runs of flepicommon ci action. --- .github/workflows/flepicommon-ci.yml | 73 +++++++++++++++++----------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index ae4ecc0e8..e80825ec0 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -26,38 +26,53 @@ jobs: uses: actions/checkout@v4 with: lfs: true - - name: Install R - run: | - UBUNTU_VERSION=$( echo "$( lsb_release -r )" | awk '{print $2}' | sed 's/\.//g' ) - curl -O https://cdn.rstudio.com/r/ubuntu-${UBUNTU_VERSION}/pkgs/r-${R_VERSION}_1_amd64.deb - sudo apt-get update - sudo apt-get install ./r-${R_VERSION}_1_amd64.deb - ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R - ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript - sudo chmod -R 777 /opt/R/4.3.3/lib/R/library - shell: bash - env: - R_VERSION: ${{ matrix.R-version }} - - name: Build flepicommon + - name: Setup R + uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.R-version }} + update-rtools: true + - name: Install System Dependencies + run: sudo apt install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libtiff5-dev + - name: Determine R Library Location run: | - R CMD build flepimop/R_packages/flepicommon/ - shell: bash - - name: Install Dependencies + R_LIBPATH=$( R -s -e "cat(.libPaths()[1L])" | xargs ) + echo "R_LIBPATH=$R_LIBPATH" >> $GITHUB_ENV + R_LIBPATH_CKSUM=$( echo "$R_LIBPATH" | cksum | cut -d ' ' -f 1 ) + echo "R_LIBPATH_CKSUM=$R_LIBPATH_CKSUM" >> $GITHUB_ENV + CACHE_DATE=$( date -d "last Sunday" +%Y%m%d ) + echo "CACHE_DATE=$CACHE_DATE" >> $GITHUB_ENV + - name: R Library Cache + uses: actions/cache@v4 + with: + key: flepicommon-rlibs-${{ runner.os }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE') }}-${{ env.R_LIBPATH_CKSUM }}-${{ env.CACHE_DATE }} + path: ${{ env.R_LIBPATH }} + - name: Install R Dependencies + if: steps.r-library-cache.outputs.cache-hit != 'true' run: | - files <- list.files() - pkg <- files[startsWith(files, "flepicommon_")] - install.packages(pkg, repos = "https://cloud.r-project.org", dependencies = TRUE) - install.packages("devtools") + install.packages( + "devtools", + repos = "https://cloud.r-project.org", + ) + library(devtools) + devtools::install_deps( + pkg = "flepimop/R_packages/flepicommon" + dependencies = TRUE + ) shell: Rscript {0} - - name: Install flepicommon + - name: Install The flepicommon Package run: | - R CMD install --help - echo "-" - TAR_GZ=$( find . -maxdepth 1 -regex ".*flepicommon.*" -printf "%P\n" ) - R CMD install $TAR_GZ - - name: Run Unit Tests + if ("flepicommon" %in% installed.packages()[,"Package"]) { + devtools::uninstall(pkg = "flepicommon") + } + devtools::install( + pkg = "flepimop/R_packages/flepicommon" + args = c(getOption("devtools.install.args"), "--install-tests"), + quick = TRUE, + dependencies = TRUE, + ) + shell: Rscript {0} + - name: Run Tests run: | - setwd("flepimop/R_packages/flepicommon") - library(devtools) - devtools::test(stop_on_failure = TRUE) + library(testthat) + test_package("flepicommon") shell: Rscript {0} From 457e94b500b9fe4f4f546d98f0cb1b0da9b9bc53 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:53:35 -0400 Subject: [PATCH 22/39] Add missing commas --- .github/workflows/flepicommon-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index e80825ec0..06d7fd8d5 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -55,7 +55,7 @@ jobs: ) library(devtools) devtools::install_deps( - pkg = "flepimop/R_packages/flepicommon" + pkg = "flepimop/R_packages/flepicommon", dependencies = TRUE ) shell: Rscript {0} @@ -65,7 +65,7 @@ jobs: devtools::uninstall(pkg = "flepicommon") } devtools::install( - pkg = "flepimop/R_packages/flepicommon" + pkg = "flepimop/R_packages/flepicommon", args = c(getOption("devtools.install.args"), "--install-tests"), quick = TRUE, dependencies = TRUE, From a16e5de11db04c7bed358c7ed77b74c8de59c94b Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:24:11 -0400 Subject: [PATCH 23/39] Manual install of deprecated covidcast --- .github/workflows/flepicommon-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 06d7fd8d5..d6b23897c 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -58,6 +58,7 @@ jobs: pkg = "flepimop/R_packages/flepicommon", dependencies = TRUE ) + install.packages("covidcast", repos = "https://cloud.r-project.org") shell: Rscript {0} - name: Install The flepicommon Package run: | From 8ccdae5518dce4f38dd91759cb85e07c6c39157a Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:53:17 -0400 Subject: [PATCH 24/39] Add missing `libudunits2-dev` for `units` pkg --- .github/workflows/flepicommon-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index d6b23897c..055d1f48d 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -32,7 +32,7 @@ jobs: r-version: ${{ matrix.R-version }} update-rtools: true - name: Install System Dependencies - run: sudo apt install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libtiff5-dev + run: sudo apt install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libtiff5-dev libudunits2-dev - name: Determine R Library Location run: | R_LIBPATH=$( R -s -e "cat(.libPaths()[1L])" | xargs ) From 3ce2b4895447329f7756d89bd807e16e0ac6642a Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:24:15 -0400 Subject: [PATCH 25/39] Missing gdal deps for `sf` package See installation instructions for the `sf` R package here: https://github.com/r-spatial/sf?tab=readme-ov-file#linux. --- .github/workflows/flepicommon-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 055d1f48d..78c77c016 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -32,7 +32,7 @@ jobs: r-version: ${{ matrix.R-version }} update-rtools: true - name: Install System Dependencies - run: sudo apt install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libtiff5-dev libudunits2-dev + run: sudo apt install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libtiff5-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev - name: Determine R Library Location run: | R_LIBPATH=$( R -s -e "cat(.libPaths()[1L])" | xargs ) From aeb96be5d96778d3b51fe13a61c3d0aeaf2c6d24 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:09:22 -0400 Subject: [PATCH 26/39] Make `inference` ci similar to `flepicommon` ci --- .github/workflows/inference-ci.yml | 99 ++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 13 deletions(-) diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 4bb2a5b8b..5958cbcff 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -22,25 +22,98 @@ on: jobs: ci: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - container: - image: hopkinsidd/flepimop:latest-dev - options: --user root + if: ${{ github.event_name != 'workflow_run' or github.event.workflow_run.conclusion == 'success' }} + strategy: + matrix: + R-version: ["4.3.3"] + python-version: ["3.10", "3.11"] steps: - name: Checkout uses: actions/checkout@v4 with: lfs: true - - name: Set up Rprofile + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install gempyor run: | - cp build/docker/Docker.Rprofile $HOME/.Rprofile - cp /home/app/.bashrc $HOME/.bashrc - shell: bash - - name: Install local R packages - run: Rscript build/local_install.R + python -m pip install --upgrade pip + python -m pip install "flepimop/gempyor_pkg[test]" shell: bash - - name: Run inference tests + - name: Setup R + uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.R-version }} + update-rtools: true + - name: Install System Dependencies + run: sudo apt install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libtiff5-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev + - name: Determine R Library Location + run: | + R_LIBPATH=$( R -s -e "cat(.libPaths()[1L])" | xargs ) + echo "R_LIBPATH=$R_LIBPATH" >> $GITHUB_ENV + R_LIBPATH_CKSUM=$( echo "$R_LIBPATH" | cksum | cut -d ' ' -f 1 ) + echo "R_LIBPATH_CKSUM=$R_LIBPATH_CKSUM" >> $GITHUB_ENV + CACHE_DATE=$( date -d "last Sunday" +%Y%m%d ) + echo "CACHE_DATE=$CACHE_DATE" >> $GITHUB_ENV + - name: R Library Cache + uses: actions/cache@v4 + with: + key: inference-rlibs-${{ runner.os }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE', 'flepimop/R_packages/inference/DESCRIPTION', 'flepimop/R_packages/inference/NAMESPACE') }}-${{ env.R_LIBPATH_CKSUM }}-${{ env.CACHE_DATE }} + path: ${{ env.R_LIBPATH }} + - name: Install R Dependencies For flepicommon + if: steps.r-library-cache.outputs.cache-hit != 'true' + run: | + install.packages( + "devtools", + repos = "https://cloud.r-project.org", + ) + library(devtools) + devtools::install_deps( + pkg = "flepimop/R_packages/flepicommon", + dependencies = TRUE + ) + install.packages("covidcast", repos = "https://cloud.r-project.org") + shell: Rscript {0} + - name: Install The flepicommon Package + run: | + if ("flepicommon" %in% installed.packages()[,"Package"]) { + devtools::uninstall(pkg = "flepicommon") + } + devtools::install( + pkg = "flepimop/R_packages/flepicommon", + quick = TRUE, + dependencies = TRUE, + ) + shell: Rscript {0} + - name: Install R Dependencies For inference + if: steps.r-library-cache.outputs.cache-hit != 'true' + run: | + install.packages( + "devtools", + repos = "https://cloud.r-project.org", + ) + library(devtools) + devtools::install_deps( + pkg = "flepimop/R_packages/inference", + dependencies = TRUE + ) + install.packages("covidcast", repos = "https://cloud.r-project.org") + - name: Install The flepicommon Package + - name: Install The inference Package + run: | + if ("inference" %in% installed.packages()[,"Package"]) { + devtools::uninstall(pkg = "inference") + } + devtools::install( + pkg = "flepimop/R_packages/inference", + args = c(getOption("devtools.install.args"), "--install-tests"), + quick = TRUE, + dependencies = TRUE, + ) + shell: Rscript {0} + - name: Run Tests run: | - setwd("flepimop/R_packages/inference") - devtools::test(stop_on_failure=TRUE) + library(testthat) + test_package("inference") shell: Rscript {0} From 551fdaa38d92113a36dd1b90d03c17745b4f73f9 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:10:59 -0400 Subject: [PATCH 27/39] Trigger `inference-ci` Removed whitespace in `flepicommon` package to stop that ci and added whitespace to the `inference` package to trigger that ci. --- flepimop/R_packages/flepicommon/R/config.R | 1 - flepimop/R_packages/inference/R/inference_to_forecast.R | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/flepimop/R_packages/flepicommon/R/config.R b/flepimop/R_packages/flepicommon/R/config.R index e4e2dd91d..6f65ff562 100644 --- a/flepimop/R_packages/flepicommon/R/config.R +++ b/flepimop/R_packages/flepicommon/R/config.R @@ -159,7 +159,6 @@ check_within_bounds <- function(value, obj) { } } - #' @name prettyprint_optlist #' @description Print a list of options such that it does not take the whole screen #' Display `name : value` \n for all elements. diff --git a/flepimop/R_packages/inference/R/inference_to_forecast.R b/flepimop/R_packages/inference/R/inference_to_forecast.R index 13431f056..112afeac8 100644 --- a/flepimop/R_packages/inference/R/inference_to_forecast.R +++ b/flepimop/R_packages/inference/R/inference_to_forecast.R @@ -28,6 +28,7 @@ cum_death_forecast <- function (sim_data, } + ##' ##' Creates a merged forecast from a data object and a set of sims. ##' From 7948050862368df500f0dd78932ff4191523881d Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:11:56 -0400 Subject: [PATCH 28/39] Limit to python 3.10 for the moment --- .github/workflows/inference-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 5958cbcff..0816205aa 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: R-version: ["4.3.3"] - python-version: ["3.10", "3.11"] + python-version: ["3.10"] steps: - name: Checkout uses: actions/checkout@v4 From 82fe326da3f21152ab7321240a70fdf56c7461a4 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:14:31 -0400 Subject: [PATCH 29/39] Fix invalid or syntax --- .github/workflows/inference-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 0816205aa..8f0e546fe 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -22,7 +22,7 @@ on: jobs: ci: runs-on: ubuntu-latest - if: ${{ github.event_name != 'workflow_run' or github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} strategy: matrix: R-version: ["4.3.3"] From db79f30cced20512a9499947a6f4b1dc0b0e552b Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:45:43 -0400 Subject: [PATCH 30/39] Remove dup `devtools` install, erroneous line --- .github/workflows/inference-ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 8f0e546fe..c841a6dfa 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -89,17 +89,11 @@ jobs: - name: Install R Dependencies For inference if: steps.r-library-cache.outputs.cache-hit != 'true' run: | - install.packages( - "devtools", - repos = "https://cloud.r-project.org", - ) - library(devtools) devtools::install_deps( pkg = "flepimop/R_packages/inference", dependencies = TRUE ) install.packages("covidcast", repos = "https://cloud.r-project.org") - - name: Install The flepicommon Package - name: Install The inference Package run: | if ("inference" %in% installed.packages()[,"Package"]) { From a05500fedc2efbe7d461ef0458b498727379c057 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:49:42 -0400 Subject: [PATCH 31/39] Avoid checking out documentation folder --- .github/workflows/flepicommon-ci.yml | 4 ++++ .github/workflows/gempyor-ci.yml | 4 ++++ .github/workflows/inference-ci.yml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 78c77c016..3b8b26ffd 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -26,6 +26,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + sparse-checkout: | + * + !documentation/ + sparse-checkout-cone-mode: false - name: Setup R uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index 86b4645a3..c6d9f398d 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -28,6 +28,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + sparse-checkout: | + * + !documentation/ + sparse-checkout-cone-mode: false - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index c841a6dfa..0b9e24e75 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -32,6 +32,10 @@ jobs: uses: actions/checkout@v4 with: lfs: true + sparse-checkout: | + * + !documentation/ + sparse-checkout-cone-mode: false - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: From 9daa90e51e0e70f527d89549c013fbf8cddc48df Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:31:37 -0400 Subject: [PATCH 32/39] Add missing shell specification --- .github/workflows/inference-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 0b9e24e75..9999f7090 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -98,6 +98,7 @@ jobs: dependencies = TRUE ) install.packages("covidcast", repos = "https://cloud.r-project.org") + shell: Rscript {0} - name: Install The inference Package run: | if ("inference" %in% installed.packages()[,"Package"]) { From 1ea7afee86e3235c47109743664e2b7c6f0ad2c7 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:16:47 -0400 Subject: [PATCH 33/39] Add R version to cache --- .github/workflows/flepicommon-ci.yml | 2 +- .github/workflows/inference-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 3b8b26ffd..8a3fff12e 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -48,7 +48,7 @@ jobs: - name: R Library Cache uses: actions/cache@v4 with: - key: flepicommon-rlibs-${{ runner.os }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE') }}-${{ env.R_LIBPATH_CKSUM }}-${{ env.CACHE_DATE }} + key: flepicommon-rlibs-${{ runner.os }}-${{ matrix.R-version }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE') }}-${{ env.R_LIBPATH_CKSUM }}-${{ env.CACHE_DATE }} path: ${{ env.R_LIBPATH }} - name: Install R Dependencies if: steps.r-library-cache.outputs.cache-hit != 'true' diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 9999f7090..77f9bd019 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -63,7 +63,7 @@ jobs: - name: R Library Cache uses: actions/cache@v4 with: - key: inference-rlibs-${{ runner.os }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE', 'flepimop/R_packages/inference/DESCRIPTION', 'flepimop/R_packages/inference/NAMESPACE') }}-${{ env.R_LIBPATH_CKSUM }}-${{ env.CACHE_DATE }} + key: inference-rlibs-${{ runner.os }}-${{ matrix.R-version }}-${{ hashFiles('flepimop/R_packages/flepicommon/DESCRIPTION', 'flepimop/R_packages/flepicommon/NAMESPACE', 'flepimop/R_packages/inference/DESCRIPTION', 'flepimop/R_packages/inference/NAMESPACE') }}-${{ env.R_LIBPATH_CKSUM }}-${{ env.CACHE_DATE }} path: ${{ env.R_LIBPATH }} - name: Install R Dependencies For flepicommon if: steps.r-library-cache.outputs.cache-hit != 'true' From 10b4a28e767785d231c32371f2b01e032e418c63 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:17:12 -0400 Subject: [PATCH 34/39] Add back python 3.11 --- .github/workflows/inference-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 77f9bd019..38c8228e8 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: R-version: ["4.3.3"] - python-version: ["3.10"] + python-version: ["3.10", "3.11"] steps: - name: Checkout uses: actions/checkout@v4 From 6c9aff7fa41bc5ca9c6435f4c8c195fedd272079 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:18:20 -0400 Subject: [PATCH 35/39] Remove whitespace to trigger full CI --- flepimop/R_packages/flepicommon/R/DataUtils.R | 1 - flepimop/gempyor_pkg/src/gempyor/__init__.py | 1 - 2 files changed, 2 deletions(-) diff --git a/flepimop/R_packages/flepicommon/R/DataUtils.R b/flepimop/R_packages/flepicommon/R/DataUtils.R index ec94e0c04..7d882c8f0 100755 --- a/flepimop/R_packages/flepicommon/R/DataUtils.R +++ b/flepimop/R_packages/flepicommon/R/DataUtils.R @@ -1019,4 +1019,3 @@ get_CSSE_US_matchGlobal_data <- function(){ } - diff --git a/flepimop/gempyor_pkg/src/gempyor/__init__.py b/flepimop/gempyor_pkg/src/gempyor/__init__.py index 432754c6c..bdf56083b 100644 --- a/flepimop/gempyor_pkg/src/gempyor/__init__.py +++ b/flepimop/gempyor_pkg/src/gempyor/__init__.py @@ -1,4 +1,3 @@ ## All functions are in minimal inference. - from .inference import * from .utils import * From 161915ed8365fed22ca150a80988ae7f1cb33075 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 18 Oct 2024 08:11:11 -0400 Subject: [PATCH 36/39] Rename 'ci' step to 'tests' --- .github/workflows/flepicommon-ci.yml | 2 +- .github/workflows/gempyor-ci.yml | 2 +- .github/workflows/inference-ci.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index 8a3fff12e..add58aab0 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -16,7 +16,7 @@ on: - dev jobs: - ci: + tests: runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index c6d9f398d..bb21b6938 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -18,7 +18,7 @@ on: - dev jobs: - ci: + tests: runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 38c8228e8..d94707896 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -20,7 +20,7 @@ on: - dev jobs: - ci: + tests: runs-on: ubuntu-latest if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} strategy: From 0bebbb355bcc65dc44f36436f2477708939b3650 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 18 Oct 2024 08:24:15 -0400 Subject: [PATCH 37/39] Remove `devtools::uninstall` calls --- .github/workflows/flepicommon-ci.yml | 4 +--- .github/workflows/inference-ci.yml | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index add58aab0..ca2a62415 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -66,14 +66,12 @@ jobs: shell: Rscript {0} - name: Install The flepicommon Package run: | - if ("flepicommon" %in% installed.packages()[,"Package"]) { - devtools::uninstall(pkg = "flepicommon") - } devtools::install( pkg = "flepimop/R_packages/flepicommon", args = c(getOption("devtools.install.args"), "--install-tests"), quick = TRUE, dependencies = TRUE, + force = TRUE ) shell: Rscript {0} - name: Run Tests diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index d94707896..54390e130 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -81,13 +81,11 @@ jobs: shell: Rscript {0} - name: Install The flepicommon Package run: | - if ("flepicommon" %in% installed.packages()[,"Package"]) { - devtools::uninstall(pkg = "flepicommon") - } devtools::install( pkg = "flepimop/R_packages/flepicommon", quick = TRUE, dependencies = TRUE, + force = TRUE ) shell: Rscript {0} - name: Install R Dependencies For inference @@ -101,14 +99,12 @@ jobs: shell: Rscript {0} - name: Install The inference Package run: | - if ("inference" %in% installed.packages()[,"Package"]) { - devtools::uninstall(pkg = "inference") - } devtools::install( pkg = "flepimop/R_packages/inference", args = c(getOption("devtools.install.args"), "--install-tests"), quick = TRUE, dependencies = TRUE, + force = TRUE ) shell: Rscript {0} - name: Run Tests From cd81c5ef3a15ea7cee7877c4ef84f292387dd877 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:13:03 -0400 Subject: [PATCH 38/39] Remove whitespace changes Remove the changes used to trigger the workflows as an example. Not needed for the PR. --- flepimop/R_packages/flepicommon/R/DataUtils.R | 1 + flepimop/R_packages/inference/R/inference_to_forecast.R | 1 - flepimop/gempyor_pkg/src/gempyor/__init__.py | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flepimop/R_packages/flepicommon/R/DataUtils.R b/flepimop/R_packages/flepicommon/R/DataUtils.R index 7d882c8f0..ec94e0c04 100755 --- a/flepimop/R_packages/flepicommon/R/DataUtils.R +++ b/flepimop/R_packages/flepicommon/R/DataUtils.R @@ -1019,3 +1019,4 @@ get_CSSE_US_matchGlobal_data <- function(){ } + diff --git a/flepimop/R_packages/inference/R/inference_to_forecast.R b/flepimop/R_packages/inference/R/inference_to_forecast.R index 112afeac8..13431f056 100644 --- a/flepimop/R_packages/inference/R/inference_to_forecast.R +++ b/flepimop/R_packages/inference/R/inference_to_forecast.R @@ -28,7 +28,6 @@ cum_death_forecast <- function (sim_data, } - ##' ##' Creates a merged forecast from a data object and a set of sims. ##' diff --git a/flepimop/gempyor_pkg/src/gempyor/__init__.py b/flepimop/gempyor_pkg/src/gempyor/__init__.py index bdf56083b..432754c6c 100644 --- a/flepimop/gempyor_pkg/src/gempyor/__init__.py +++ b/flepimop/gempyor_pkg/src/gempyor/__init__.py @@ -1,3 +1,4 @@ ## All functions are in minimal inference. + from .inference import * from .utils import * From f67ffeb25c0618665bbb3e0884e81eb83b622614 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:22:58 -0400 Subject: [PATCH 39/39] Remove `dev` branch from triggers --- .github/workflows/flepicommon-ci.yml | 2 -- .github/workflows/gempyor-ci.yml | 2 -- .github/workflows/inference-ci.yml | 2 -- 3 files changed, 6 deletions(-) diff --git a/.github/workflows/flepicommon-ci.yml b/.github/workflows/flepicommon-ci.yml index ca2a62415..9f8abc089 100644 --- a/.github/workflows/flepicommon-ci.yml +++ b/.github/workflows/flepicommon-ci.yml @@ -7,13 +7,11 @@ on: - flepimop/R_packages/flepicommon/**/* branches: - main - - dev pull_request: paths: - flepimop/R_packages/flepicommon/**/* branches: - main - - dev jobs: tests: diff --git a/.github/workflows/gempyor-ci.yml b/.github/workflows/gempyor-ci.yml index bb21b6938..e2637f1af 100644 --- a/.github/workflows/gempyor-ci.yml +++ b/.github/workflows/gempyor-ci.yml @@ -8,14 +8,12 @@ on: - flepimop/gempyor_pkg/**/* branches: - main - - dev pull_request: paths: - examples/**/* - flepimop/gempyor_pkg/**/* branches: - main - - dev jobs: tests: diff --git a/.github/workflows/inference-ci.yml b/.github/workflows/inference-ci.yml index 54390e130..d80a2e735 100644 --- a/.github/workflows/inference-ci.yml +++ b/.github/workflows/inference-ci.yml @@ -11,13 +11,11 @@ on: - flepimop/R_packages/inference/**/* branches: - main - - dev pull_request: paths: - flepimop/R_packages/inference/**/* branches: - main - - dev jobs: tests: