From bf7c7eb229a436d6c10fb8623d9d0d29399ac5b1 Mon Sep 17 00:00:00 2001 From: phauchamps Date: Tue, 9 Jan 2024 17:00:07 +0100 Subject: [PATCH] test again GHA workflow with modifs (wip) --- .github/workflows/check-bioc.yml | 326 +++++++++++++++---------------- 1 file changed, 163 insertions(+), 163 deletions(-) diff --git a/.github/workflows/check-bioc.yml b/.github/workflows/check-bioc.yml index 0a6462c..e1e9bb4 100644 --- a/.github/workflows/check-bioc.yml +++ b/.github/workflows/check-bioc.yml @@ -162,175 +162,175 @@ jobs: message(paste('****', Sys.time(), 'installing BiocManager ****')) remotes::install_cran("BiocManager") shell: Rscript {0} - - # - name: Manually install vdiffr in version 1.0.5 to avoid compil error - # run: | - # BiocManager::install("remotes") - # remotes::install_version("vdiffr", version = "1.0.5") - # shell: Rscript {0} - name: Set BiocVersion run: | BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE) shell: Rscript {0} - - - name: Install dependencies - run: | - withr::with_makevars( - c(CFLAGS = "-w", - CXXFLAGS = "-w"), - { - ## Try installing the package dependencies in steps. First the local - ## dependencies, then any remaining dependencies to avoid the - ## issues described at - ## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html - ## https://github.com/r-lib/remotes/issues/296 - ## Ideally, all dependencies should get installed in the first pass. - - ## Pass #1 at installing dependencies - message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****')) - local_deps <- remotes::local_package_deps(dependencies = TRUE) - deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories()) - BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]]) - - ## Pass #2 at installing dependencies - message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****')) - deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories()) - BiocManager::install(deps$package[deps$diff != 0]) - - ## For running the checks - message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****')) - remotes::install_cran("rcmdcheck") - BiocManager::install("BiocCheck") - }, - assignment = "+=") - - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - ## Fix error: The magick package is required to crop "...png" but not available. - - name: Manually install magick - run: BiocManager::install("magick") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Install BiocGenerics - if: env.has_RUnit == 'true' - run: | - ## Install BiocGenerics - BiocManager::install("BiocGenerics") - shell: Rscript {0} - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Install covr - ##if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux' - if: env.run_covr == 'true' && runner.os == 'Linux' - run: | - remotes::install_cran("covr") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Install pkgdown - ##if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' - if: env.run_pkgdown == 'true' && runner.os == 'Linux' - run: | - remotes::install_github("r-lib/pkgdown") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Run CMD check - env: - _R_CHECK_CRAN_INCOMING_: false + - pre-install cytolib run: | - rcmdcheck::rcmdcheck( - args = c("--no-build-vignettes", "--no-manual", "--timings"), - build_args = c("--no-manual", "--no-resave-data"), - error_on = "warning", - check_dir = "check" - ) + BiocManager::install("cytolib") shell: Rscript {0} + - ## Might need an to add this to the if: && runner.os == 'Linux' - - name: Reveal testthat details - if: env.has_testthat == 'true' - run: find . -name testthat.Rout -exec cat '{}' ';' - - - name: Run RUnit tests - if: env.has_RUnit == 'true' - run: | - BiocGenerics:::testPackage() - shell: Rscript {0} - - - name: Run BiocCheck - if: env.has_BiocCheck == 'true' - run: | - BiocCheck::BiocCheck( - dir('check', 'tar.gz$', full.names = TRUE), - `quit-with-status` = TRUE, - `no-check-R-ver` = TRUE, - `no-check-bioc-help` = TRUE - ) - shell: Rscript {0} - - - name: Test coverage - #if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux' - if: env.run_covr == 'true' && runner.os == 'Linux' - run: | - covr::codecov(quiet = FALSE) - shell: Rscript {0} - - - name: Install package - #if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' - if: env.run_pkgdown == 'true' && runner.os == 'Linux' - run: R CMD INSTALL . - - - name: Deploy package - #if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' - if: env.run_pkgdown == 'true' && runner.os == 'Linux' - run: | - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" - git config --global --add safe.directory /__w/CytoMDS/CytoMDS - Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)" - shell: bash {0} - ## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE) - ## at least one locally before this will work. This creates the gh-pages - ## branch (erasing anything you haven't version controlled!) and - ## makes the git history recognizable by pkgdown. - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@master - with: - name: ${{ runner.os }}-biocversion-devel-r-devel-results - path: check + # - name: Install dependencies + # run: | + # withr::with_makevars( + # c(CFLAGS = "-w", + # CXXFLAGS = "-w"), + # { + # ## Try installing the package dependencies in steps. First the local + # ## dependencies, then any remaining dependencies to avoid the + # ## issues described at + # ## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html + # ## https://github.com/r-lib/remotes/issues/296 + # ## Ideally, all dependencies should get installed in the first pass. + # + # ## Pass #1 at installing dependencies + # message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****')) + # local_deps <- remotes::local_package_deps(dependencies = TRUE) + # deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories()) + # BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]]) + # + # ## Pass #2 at installing dependencies + # message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****')) + # deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories()) + # BiocManager::install(deps$package[deps$diff != 0]) + # + # ## For running the checks + # message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****')) + # remotes::install_cran("rcmdcheck") + # BiocManager::install("BiocCheck") + # }, + # assignment = "+=") + # + # shell: Rscript {0} + # + # - name: Session info + # run: | + # options(width = 100) + # pkgs <- installed.packages()[, "Package"] + # sessioninfo::session_info(pkgs, include_base = TRUE) + # shell: Rscript {0} + # + # ## Fix error: The magick package is required to crop "...png" but not available. + # - name: Manually install magick + # run: BiocManager::install("magick") + # shell: Rscript {0} + # + # - name: Session info + # run: | + # options(width = 100) + # pkgs <- installed.packages()[, "Package"] + # sessioninfo::session_info(pkgs, include_base = TRUE) + # shell: Rscript {0} + # + # - name: Install BiocGenerics + # if: env.has_RUnit == 'true' + # run: | + # ## Install BiocGenerics + # BiocManager::install("BiocGenerics") + # shell: Rscript {0} + # + # - name: Session info + # run: | + # options(width = 100) + # pkgs <- installed.packages()[, "Package"] + # sessioninfo::session_info(pkgs, include_base = TRUE) + # shell: Rscript {0} + # + # - name: Install covr + # ##if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux' + # if: env.run_covr == 'true' && runner.os == 'Linux' + # run: | + # remotes::install_cran("covr") + # shell: Rscript {0} + # + # - name: Session info + # run: | + # options(width = 100) + # pkgs <- installed.packages()[, "Package"] + # sessioninfo::session_info(pkgs, include_base = TRUE) + # shell: Rscript {0} + # + # - name: Install pkgdown + # ##if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' + # if: env.run_pkgdown == 'true' && runner.os == 'Linux' + # run: | + # remotes::install_github("r-lib/pkgdown") + # shell: Rscript {0} + # + # - name: Session info + # run: | + # options(width = 100) + # pkgs <- installed.packages()[, "Package"] + # sessioninfo::session_info(pkgs, include_base = TRUE) + # shell: Rscript {0} + # + # - name: Run CMD check + # env: + # _R_CHECK_CRAN_INCOMING_: false + # run: | + # rcmdcheck::rcmdcheck( + # args = c("--no-build-vignettes", "--no-manual", "--timings"), + # build_args = c("--no-manual", "--no-resave-data"), + # error_on = "warning", + # check_dir = "check" + # ) + # shell: Rscript {0} + # + # ## Might need an to add this to the if: && runner.os == 'Linux' + # - name: Reveal testthat details + # if: env.has_testthat == 'true' + # run: find . -name testthat.Rout -exec cat '{}' ';' + # + # - name: Run RUnit tests + # if: env.has_RUnit == 'true' + # run: | + # BiocGenerics:::testPackage() + # shell: Rscript {0} + # + # - name: Run BiocCheck + # if: env.has_BiocCheck == 'true' + # run: | + # BiocCheck::BiocCheck( + # dir('check', 'tar.gz$', full.names = TRUE), + # `quit-with-status` = TRUE, + # `no-check-R-ver` = TRUE, + # `no-check-bioc-help` = TRUE + # ) + # shell: Rscript {0} + # + # - name: Test coverage + # #if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux' + # if: env.run_covr == 'true' && runner.os == 'Linux' + # run: | + # covr::codecov(quiet = FALSE) + # shell: Rscript {0} + # + # - name: Install package + # #if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' + # if: env.run_pkgdown == 'true' && runner.os == 'Linux' + # run: R CMD INSTALL . + # + # - name: Deploy package + # #if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' + # if: env.run_pkgdown == 'true' && runner.os == 'Linux' + # run: | + # git config --global user.email "actions@github.com" + # git config --global user.name "GitHub Actions" + # git config --global --add safe.directory /__w/CytoMDS/CytoMDS + # Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)" + # shell: bash {0} + # ## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE) + # ## at least one locally before this will work. This creates the gh-pages + # ## branch (erasing anything you haven't version controlled!) and + # ## makes the git history recognizable by pkgdown. + # + # - name: Upload check results + # if: failure() + # uses: actions/upload-artifact@master + # with: + # name: ${{ runner.os }}-biocversion-devel-r-devel-results + # path: check