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] 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}