Skip to content

Commit

Permalink
revdep on GA
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Aug 1, 2024
1 parent ee65e77 commit 1d67670
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 114 deletions.
145 changes: 145 additions & 0 deletions .github/workflows/recheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Run a recheck

on:
workflow_call:
inputs:
which:
description: Should be 'strong' or 'most'.
type: string
default: strong
required: false

env:
R_LIBS_USER: ${{github.workspace}}/pkglib
_R_CHECK_FORCE_SUGGESTS_: 'FALSE'
_R_CHECK_CRAN_INCOMING_: 'FALSE'
_R_CHECK_VIGNETTES_SKIP_RUN_MAYBE_: 'TRUE' #remove for R-4.4
_R_CHECK_ELAPSED_TIMEOUT_: 3600
GITHUB_ACTIONS: ''
CI: ''

jobs:
prepare:
name: Prepare dependencies
runs-on: ubuntu-latest
container: ghcr.io/r-devel/recheck
outputs:
oldfile: ${{ steps.filenames.outputs.oldfile }}
newfile: ${{ steps.filenames.outputs.newfile }}
steps:
- name: prepare
run: |
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: download dependencies
run: rechecktools::install_recheck_deps('source', '${{inputs.which}}')
shell: Rscript {0}

- name: build source package
run: |
mkdir newpkg
R CMD build source
mv *.tar.gz newpkg/
rm -Rf source
- name: Get old version of package
shell: Rscript {0}
run: |
dir.create("oldpkg")
pkg <- sub("_.*", "", list.files("newpkg"))
download.packages(pkg, "oldpkg", repos = "https://cran.r-project.org")
- name: Get file names
id: filenames
run: |
echo "oldfile=$(cd oldpkg; echo *.tar.gz)" >> "$GITHUB_OUTPUT"
echo "newfile=$(cd newpkg; echo *.tar.gz)" >> "$GITHUB_OUTPUT"
- name: Save package and library
uses: actions/cache/save@v4
with:
path: |
pkglib
newpkg
oldpkg
key: ${{ runner.os }}-${{ github.run_id }}-${{github.run_attempt}}

checks:
needs: prepare
runs-on: ubuntu-latest
name: Recheck ${{matrix.check == 'oldpkg' && needs.prepare.outputs.oldfile || needs.prepare.outputs.newfile}} (${{matrix.check}})
container: ghcr.io/r-devel/recheck
timeout-minutes: 600
strategy:
matrix:
check: [ 'oldpkg', 'newpkg' ]
steps:

- name: Download package and library
uses: actions/cache/restore@v4
with:
path: |
pkglib
newpkg
oldpkg
key: ${{ runner.os }}-${{ github.run_id }}-${{github.run_attempt}}

- name: Run checks
shell: Rscript {0}
run: |
checkdir <- "${{matrix.check}}"
options(repos = c(CRAN = 'https://cloud.r-project.org'))
reverse <- list(repos = 'https://cloud.r-project.org', which = "${{ inputs.which }}")
Sys.setenv(R_PROFILE="nothing") # do not set binary p3m mirror in child proc
tools::check_packages_in_dir(checkdir, reverse = reverse, Ncpus = parallel::detectCores())
details <- tools::check_packages_in_dir_details(checkdir)
write.csv(details, file.path(checkdir, 'check-details.csv'))
writeLines(paste(format(details), collapse = "\n\n"), file.path(checkdir, 'check-details.txt'))
tools::summarize_check_packages_in_dir_results(checkdir)
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.check}}-checklogs
path: |
${{matrix.check}}/*/*.log
${{matrix.check}}/*/*.out
${{matrix.check}}/*/*.Rout
${{matrix.check}}/*/*.fail
${{matrix.check}}/Outputs
${{matrix.check}}/check-details.*
results:
name: Show results
needs: checks
runs-on: ubuntu-latest
container: ghcr.io/r-hub/r-minimal/r-minimal:latest
steps:
- name: Download log files
uses: actions/download-artifact@v4

- name: Get results
shell: Rscript {0}
run: |
cat("\n------- Check results summary ------\n")
tools::summarize_check_packages_in_dir_results("newpkg-checklogs")
# Check for regressions
cat("\n------- Check for regressions ------\n")
changes <- tools::check_packages_in_dir_changes("newpkg-checklogs", "oldpkg-checklogs")
if(nrow(changes)){
cat("Changes:\n")
print(changes)
stop("Found potential problems")
} else {
cat("No changes between old and new version\n")
}
3 changes: 1 addition & 2 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ navbar:

articles:
- title: User guide
desc: ~
navbar: User Guide
navbar: ~
contents:
- '`improved-boxes`'
- '`box-elements`'
Expand Down
6 changes: 0 additions & 6 deletions revdep/.gitignore

This file was deleted.

29 changes: 0 additions & 29 deletions revdep/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions revdep/cran.md

This file was deleted.

4 changes: 0 additions & 4 deletions revdep/email.yml

This file was deleted.

65 changes: 0 additions & 65 deletions revdep/failures.md

This file was deleted.

1 change: 0 additions & 1 deletion revdep/problems.md

This file was deleted.

0 comments on commit 1d67670

Please sign in to comment.