Skip to content

Commit

Permalink
Add support for checking a package in a subdirectory (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
amoeba authored Aug 21, 2024
1 parent 63142da commit 34d6042
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/recheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down Expand Up @@ -142,4 +152,3 @@ jobs:
} else {
cat("No changes between old and new version\n")
}

0 comments on commit 34d6042

Please sign in to comment.