From 34d6042f4793ef74bb4bf669a5edb50728a75cca Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Wed, 21 Aug 2024 14:11:49 -0700 Subject: [PATCH] Add support for checking a package in a subdirectory (#6) --- .github/workflows/recheck.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/recheck.yml b/.github/workflows/recheck.yml index 33b4d67..891ce5b 100644 --- a/.github/workflows/recheck.yml +++ b/.github/workflows/recheck.yml @@ -8,6 +8,11 @@ on: type: string default: strong required: false + subdirectory: + description: Subdirectory of R package to be checked + required: false + type: string + default: '' env: R_LIBS_USER: ${{github.workspace}}/pkglib @@ -32,24 +37,29 @@ jobs: mkdir -p $R_LIBS_USER R -e ".libPaths()" -# - name: clone -# run: git clone --depth=1 https://github.com/${{github.repository}} source - - name: checkout uses: actions/checkout@v4 with: path: source + - name: Set package source directory + run: | + if [ -n "${{ github.event.inputs.subdirectory }}" ]; then + echo "PKG_SOURCE_DIR=source/${{ github.event.inputs.subdirectory }}" >> $GITHUB_ENV + else + echo "PKG_SOURCE_DIR=source" >> $GITHUB_ENV + fi + - name: download dependencies - run: rechecktools::install_recheck_deps('source', '${{inputs.which}}') + run: rechecktools::install_recheck_deps('${{env.PKG_SOURCE_DIR}}', '${{inputs.which}}') shell: Rscript {0} - name: build source package run: | mkdir newpkg - R CMD build source + R CMD build ${{env.PKG_SOURCE_DIR}} mv *.tar.gz newpkg/ - rm -Rf source + rm -Rf ${{env.PKG_SOURCE_DIR}} - name: Get old version of package shell: Rscript {0} @@ -142,4 +152,3 @@ jobs: } else { cat("No changes between old and new version\n") } -