combine #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Workflow derived from https://github.com/r-lib/actions/tree/master/examples | |
| # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
| on: | |
| push: | |
| branches: | |
| - revdep-workflow-testing | |
| workflow_dispatch: | |
| name: Reverse Dependency Checks | |
| jobs: | |
| revdep-checks: | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| batch: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
| name: Reverse dependency checks (batch ${{ matrix.batch }}) | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| R_KEEP_PKG_SOURCE: yes | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: r-lib/actions/setup-r@v2 | |
| - name: Install R Package Build Dependencies | |
| uses: r-hub/actions/setup-r-sysreqs@v1 | |
| with: | |
| type: full | |
| - name: Install additional build dependencies | |
| run: brew install jags | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: rstanarm BH RcppEigen RcppParallel local::. | |
| - name: Check reverse dependencies (batch ${{ matrix.batch }}) | |
| run: | | |
| revdeps <- tools::package_dependencies("rstantools", reverse = TRUE, which = "all")$rstantools | |
| revdeps <- split(revdeps, cut(seq_along(revdeps), 10, labels = FALSE)) | |
| curr_revdeps <- revdeps[[${{ matrix.batch }}]] | |
| revdep_details <- available.packages()[available.packages()[,"Package"] %in% curr_revdeps,] | |
| pkg_tar_names <- paste0(revdep_details[,"Package"], "_", revdep_details[,"Version"], ".tar.gz") | |
| dir.create("./revdepchecks") | |
| download.file( | |
| url = paste0(revdep_details[,"Repository"], "/", pkg_tar_names), | |
| destfile = file.path(getwd(), "revdepchecks", pkg_tar_names), | |
| method = "libcurl", | |
| mode = "wb" | |
| ) | |
| pak::pak(revdep_details[,"Package"]) | |
| tools::check_packages_in_dir("./revdepchecks", Ncpus = 3) | |
| res <- tools::check_packages_in_dir_details("revdepchecks/") | |
| saveRDS(res, file = "batch-${{ matrix.batch }}-status.rds") | |
| shell: Rscript {0} | |
| - name: Upload reverse dependency check results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: revdep-batch-${{ matrix.batch }} | |
| path: batch-${{ matrix.batch }}-status.rds | |
| # Combine all results | |
| combine-results: | |
| runs-on: macos-latest | |
| needs: revdep-checks | |
| if: always() | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Combine reverse dependency check results | |
| run: | | |
| files <- list.files(pattern = "batch-\\d+-status.rds") | |
| res <- do.call(rbind.data.frame, lapply(files, readRDS)) | |
| saveRDS(res, file = "revdep-status.rds") | |
| shell: Rscript {0} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: revdep-status | |
| path: revdep-status.rds |