Merge pull request #155 from neurogenomics/dev2 #237
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
| name: rworkflows_static | |
| 'on': | |
| push: | |
| branches: | |
| - master | |
| - main | |
| - devel | |
| - RELEASE_** | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| - devel | |
| - RELEASE_** | |
| env: | |
| run_bioccheck: ${{ false }} | |
| run_rcmdcheck: ${{ true }} | |
| as_cran: ${{ true }} | |
| run_vignettes: ${{ true }} | |
| has_testthat: ${{ true }} | |
| run_lintr: ${{ true }} | |
| run_spelling: ${{ true }} | |
| run_covr: ${{ true }} | |
| run_pkgdown: ${{ true }} | |
| has_runit: ${{ false }} | |
| has_latex: ${{ false }} | |
| tinytex_installer: TinyTeX-1 | |
| pandoc_version: '2.19' | |
| run_docker: ${{ false }} | |
| docker_registry: ghcr.io | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} | |
| ncpus: 2.0 | |
| timeout: 2000.0 | |
| force_install: ${{ false }} | |
| run_telemetry: ${{ true }} | |
| free_diskspace: ${{ false }} | |
| cache_version: cache-v1 | |
| miniforge_variant: ${{ false }} | |
| activate_environment: test | |
| jobs: | |
| rworkflows_static: | |
| permissions: write-all | |
| runs-on: ${{ matrix.config.os }} | |
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
| container: ${{ matrix.config.cont }} | |
| strategy: | |
| fail-fast: ${{ false }} | |
| matrix: | |
| config: | |
| - os: ubuntu-latest | |
| bioc: devel | |
| r: auto | |
| cont: ghcr.io/bioconductor/bioconductor_docker:devel | |
| rspm: ~ | |
| - os: macOS-latest | |
| bioc: release | |
| r: auto | |
| cont: ~ | |
| rspm: ~ | |
| - os: windows-latest | |
| bioc: release | |
| r: auto | |
| cont: ~ | |
| rspm: ~ | |
| env: | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: ${{ true }} | |
| RSPM: ${{ matrix.config.rspm }} | |
| TZ: UTC | |
| GITHUB_REPO: ${{ github.repository }} | |
| RGL_USE_NULL: ${{ true }} | |
| steps: | |
| - name: "\U0001F52D Collect Workflow Telemetry" | |
| if: env.run_telemetry == 'true' | |
| uses: catchpoint/workflow-telemetry-action@v2 | |
| continue-on-error: ${{ true }} | |
| with: | |
| github_token: ${{ env.GITHUB_TOKEN }} | |
| comment_on_pr: ${{ false }} | |
| - name: "\U0001F4BE Free Disk Space" | |
| if: env.free_diskspace == 'true' && runner.os == 'Linux' | |
| uses: jlumbroso/free-disk-space@main | |
| - name: "\U0001F30E Set environment variables" | |
| run: | | |
| echo "RGL_USE_NULL=TRUE" >> $GITHUB_ENV | |
| echo "R_REMOTES_NO_ERRORS_FROM_WARNINGS=${{ true }}" >> $GITHUB_ENV | |
| echo "RSPM=${{ matrix.config.rspm }}" >> $GITHUB_ENV | |
| echo "TZ=UTC" >> $GITHUB_ENV | |
| echo "NOT_CRAN=${{ !env.as_cran }}" >> $GITHUB_ENV | |
| shell: bash {0} | |
| - name: β¬ Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: "\U0001F40D Setup Miniconda" | |
| if: env.miniforge_variant != 'false' | |
| uses: conda-incubator/setup-miniconda@v4 | |
| with: | |
| auto-update-conda: ${{ false }} | |
| python-version: ${{ matrix.python-version }} | |
| miniforge-variant: ${{ env.miniforge_variant }} | |
| miniforge-version: ${{ env.miniforge_version }} | |
| activate-environment: ${{ env.activate_environment }} | |
| environment-file: ${{ env.environment_file }} | |
| channels: ${{ env.channels }} | |
| - name: "\U0001F4DA Set R library home on Linux" | |
| if: runner.os == 'Linux' | |
| run: | | |
| mkdir -p /__w/_temp/Library | |
| echo ".libPaths('/__w/_temp/Library')" >> ~/.Rprofile | |
| git config --global --add safe.directory '*' | |
| shell: bash {0} | |
| - name: "\U0001F6E0 Setup R and Bioconductor" | |
| if: runner.os != 'Linux' | |
| uses: grimbough/bioc-actions/setup-bioc@v1 | |
| with: | |
| bioc-version: ${{ matrix.config.bioc }} | |
| Ncpus: ${{ env.ncpus }} | |
| - name: "\U0001F6E0 Install Pandoc" | |
| if: env.pandoc_version != 'false' && runner.os != 'Linux' | |
| uses: r-lib/actions/setup-pandoc@v2 | |
| with: | |
| pandoc-version: ${{ env.pandoc_version }} | |
| - name: β Query dependencies | |
| env: | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| options(crayon.enabled = TRUE) | |
| install.packages('remotes') | |
| remotes::install_github("r-lib/remotes") | |
| saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
| shell: Rscript {0} | |
| - name: "\U0001F3E6 Restore R package cache" | |
| if: | | |
| !contains(github.event.head_commit.message, '[nocache]') && runner.os != 'Linux' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.R_LIBS_USER }} | |
| key: ${{ env.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc | |
| }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }} | |
| restore-keys: ${{ env.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc | |
| }}-r-${{ matrix.config.r }}- | |
| - name: "\U0001F3E6 Cache R packages on Linux" | |
| if: | | |
| !contains(github.event.head_commit.message, '[nocache]') && runner.os == 'Linux' | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/work/_temp/Library | |
| key: ${{ env.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc | |
| }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }} | |
| restore-keys: ${{ env.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc | |
| }}-r-${{ matrix.config.r }}- | |
| - name: "\U0001F6E0 Install Linux system dependencies" | |
| if: runner.os == 'Linux' | |
| run: | | |
| sysreqs=$(Rscript -e 'cat("apt-get update -y && apt-get install -y", paste(gsub("apt-get install -y ", "", remotes::system_requirements("ubuntu", "22.04")), collapse = " "))') | |
| echo $sysreqs | |
| sudo -s eval "$sysreqs" | |
| sudo apt-get install -y qpdf rsync | |
| shell: bash {0} | |
| - name: "\U0001F6E0 Install macOS system dependencies" | |
| if: runner.os == 'macOS' | |
| run: | | |
| #### --- Justifications for each package --- #### | |
| ### libxml2 ### | |
| # Enable installing XML from source if needed | |
| ### imagemagick@6 ### | |
| # Required to install magick as noted at | |
| # https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2 | |
| ### harfbuzz fribidi ### | |
| # For textshaping, required by ragg, and required by pkgdown | |
| ### libgit2 ### | |
| # For installing usethis's dependency gert | |
| ### xquartz --cask ### | |
| # Required for tcltk | |
| ### libxfont ### | |
| # Required for some ggplot2 functions | |
| ### texlive ### | |
| # Required for rendering Sweave files (even with r-lib/actions/setup-tinytex) | |
| #### --- Install packages --- #### | |
| ### Install normally ### | |
| brew install libxml2 imagemagick@6 harfbuzz fribidi libgit2 texlive | |
| ### Install via cask ### | |
| brew install xquartz --cask | |
| ### Set up xml2 ### | |
| echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV | |
| shell: bash {0} | |
| - name: "\U0001F6E0 Install Windows system dependencies" | |
| if: env.has_latex == 'true' && runner.os == 'Windows' | |
| run: | | |
| #### npm #### | |
| npm install curl | |
| shell: pwsh {0} | |
| - name: "\U0001F6E0 Install latex" | |
| if: env.has_latex == 'true' | |
| uses: r-lib/actions/setup-tinytex@v2 | |
| env: | |
| TINYTEX_INSTALLER: ${{ env.tinytex_installer }} | |
| TINYTEX_VERSION: ${{ env.tinytex_version }} | |
| - name: "\U0001F6E0 Install latex packages" | |
| if: env.has_latex == 'true' | |
| env: | |
| tinytex_installer: ${{ env.tinytex_installer }} | |
| tinytex_version: ${{ env.tinytex_version }} | |
| run: | | |
| install.packages("tinytex") | |
| extra_packages <- c("bera","nowidow","parnotes","marginfix","etoolbox", | |
| "titlesec","sectsty","framed","enumitem","parskip","soul","placeins", | |
| "footmisc","changepage","xstring","caption","mathtools","fancyhdr", | |
| "preprint","ragged2e","pdfcrop","titling","silence","everysel") | |
| tinytex::tlmgr_install(pkgs = extra_packages) | |
| shell: Rscript {0} | |
| - name: "\U0001F6E0 Install dependencies pass 1" | |
| env: | |
| timeout: ${{ env.timeout }} | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| force_install: ${{ env.force_install }} | |
| ncpus: ${{ env.ncpus }} | |
| run: | | |
| options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"), Ncpus=as.integer(Sys.getenv("ncpus"))) | |
| ## For running the checks | |
| message(paste('****', Sys.time(), 'installing rcmdcheck ****')) | |
| install.packages(c("rmarkdown","BiocManager"), dependencies = TRUE) | |
| message(paste('****', Sys.time(), 'pass number 1 at installing dependencies****')) | |
| message(paste('**** Using', Sys.getenv("ncpus"), 'cores for installation.')) | |
| repos <- BiocManager::repositories() | |
| remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=Sys.getenv("force_install")) | |
| continue-on-error: ${{ true }} | |
| shell: Rscript {0} | |
| - name: "\U0001F6E0 Install dependencies pass 2" | |
| env: | |
| timeout: ${{ env.timeout }} | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| ncpus: ${{ env.ncpus }} | |
| run: | | |
| options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"), Ncpus=as.integer(Sys.getenv("ncpus"))) | |
| message(paste('****', Sys.time(), 'pass number 2 at installing dependencies****')) | |
| repos <- BiocManager::repositories() | |
| remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE) | |
| shell: Rscript {0} | |
| - name: "\U0001F6E0 Install RUnit (via BiocGenerics)" | |
| if: env.has_runit == 'true' | |
| run: | | |
| options(crayon.enabled = TRUE) | |
| BiocManager::install("BiocGenerics") | |
| shell: Rscript {0} | |
| - name: "\U0001F6E0 Install covr" | |
| if: env.run_covr == 'true' && runner.os == 'Linux' | |
| run: | | |
| options(crayon.enabled = TRUE) | |
| install.packages("covr") | |
| shell: Rscript {0} | |
| - name: "\U0001F6E0 Install pkgdown" | |
| if: env.run_pkgdown == 'true' && runner.os == 'Linux' | |
| run: | | |
| options(crayon.enabled = TRUE) | |
| install.packages("pkgdown") | |
| shell: Rscript {0} | |
| - name: "\U0001F6E0 Install gh cli and jq" | |
| if: env.run_pkgdown == 'true' && runner.os == 'Linux' | |
| run: | | |
| sudo apt-get install -y gh jq | |
| shell: bash {0} | |
| - name: "\U0001F6E0 Update quarto to latest release" | |
| if: env.run_pkgdown == 'true' && runner.os == 'Linux' | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| with: | |
| version: release | |
| - name: βΉοΈ Session info οΈ | |
| run: | | |
| options(width = 100, crayon.enabled = TRUE) | |
| pkgs <- installed.packages()[,"Package"] | |
| if(!require("sessioninfo", quietly=TRUE)) install.packages("sessioninfo") | |
| tryCatch({ | |
| sessioninfo::session_info(pkgs, include_base = TRUE) | |
| }, error = function(x){utils::sessionInfo()}) | |
| shell: Rscript {0} | |
| - name: β Run CMD check | |
| if: env.run_rcmdcheck == 'true' | |
| env: | |
| _R_CHECK_CRAN_INCOMING_: ${{ false }} | |
| RGL_USE_NULL: ${{ env.RGL_USE_NULL }} | |
| DISPLAY: 99.0 | |
| AS_CRAN: ${{ env.as_cran }} | |
| run_vignettes: ${{ env.run_vignettes }} | |
| timeout: ${{ env.timeout }} | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) | |
| if(!require("rcmdcheck", quietly=TRUE)) install.packages("rcmdcheck") | |
| as_cran <- if(Sys.getenv("AS_CRAN")=='true') "--as-cran" else NULL | |
| run_build_vignettes <- if(Sys.getenv("run_vignettes")=='true') NULL else "--no-build-vignettes" | |
| run_vignettes <- if(Sys.getenv("run_vignettes")=='true') NULL else "--ignore-vignettes" | |
| rcmdcheck::rcmdcheck( | |
| args = c("--no-manual", "--timings", as_cran, run_vignettes), | |
| build_args = c("--no-manual", "--keep-empty-dirs", "--no-resave-data", run_build_vignettes), | |
| error_on = "warning", | |
| check_dir = "check") | |
| shell: Rscript {0} | |
| - name: "\U0001F4CB Reveal testthat details" | |
| if: env.has_testthat == 'true' | |
| run: | | |
| find . -name testthat.Rout -exec cat '{}' ';' | |
| shell: bash {0} | |
| - name: "\U0001F4CB Run RUnit tests (via BiocGenerics)" | |
| if: env.has_runit == 'true' | |
| env: | |
| timeout: ${{ env.timeout }} | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) | |
| BiocGenerics:::testPackage() | |
| shell: Rscript {0} | |
| - name: β Run BiocCheck | |
| if: env.run_bioccheck == 'true' | |
| env: | |
| DISPLAY: 99.0 | |
| RGL_USE_NULL: ${{ env.RGL_USE_NULL }} | |
| run_vignettes: ${{ env.run_vignettes }} | |
| as_cran: ${{ env.as_cran }} | |
| timeout: ${{ env.timeout }} | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) | |
| #### Install deps #### | |
| if(!require("BiocManager", quietly=TRUE)) install.packages("BiocManager") | |
| if(!require("BiocCheck", quietly=TRUE)) BiocManager::install("BiocCheck") | |
| #### Allow for packages on CRAN #### | |
| no_check_vignettes <- Sys.getenv("run_vignettes")=='true' | |
| as_cran <- Sys.getenv("as_cran")=='true' | |
| #### Run checks #### | |
| BiocCheck::BiocCheck( | |
| dir('check', 'tar.gz$', full.names = TRUE), | |
| `quit-with-status` = TRUE, | |
| `no-check-R-ver` = TRUE, | |
| `no-check-vignettes` = no_check_vignettes, | |
| `no-check-CRAN` = as_cran, | |
| `no-check-bioc-help` = as_cran) | |
| shell: Rscript {0} | |
| - name: "\U0001F4CB Test coverage" | |
| if: env.run_covr == 'true' && runner.os == 'Linux' | |
| env: | |
| CODECOV_TOKEN: ${{ env.CODECOV_TOKEN }} | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| ## NOTE: codecov() uses CODECOV_TOKEN env var if specified. | |
| ## (recommended) | |
| covr::codecov() | |
| shell: Rscript {0} | |
| - name: "\U0001F9F9 Lint package (lintr)" | |
| if: env.run_lintr == 'true' && runner.os == 'Linux' | |
| continue-on-error: ${{ true }} | |
| run: | | |
| options(crayon.enabled = TRUE) | |
| if(!require("lintr", quietly=TRUE)) install.packages("lintr") | |
| lints <- tryCatch(lintr::lint_package(), | |
| error = function(e){ | |
| message("lintr failed: ", conditionMessage(e)); list() | |
| }) | |
| message(sprintf("**** Found %d lint(s) ****", length(lints))) | |
| for (l in lints) { | |
| cat(sprintf("::warning file=%s,line=%s,col=%s::[lintr] %s\n", | |
| l$filename, | |
| if(is.null(l$line_number)) 1 else l$line_number, | |
| if(is.null(l$column_number)) 1 else l$column_number, | |
| l$message)) | |
| } | |
| gh_sum <- Sys.getenv("GITHUB_STEP_SUMMARY") | |
| if (nzchar(gh_sum)) { | |
| parts <- "## π§Ή lintr results\n\n" | |
| if (length(lints) == 0) { | |
| parts <- c(parts, "No lints found β \n\n") | |
| } else { | |
| parts <- c(parts, sprintf("**Found %d lint(s)**\n\n", length(lints)), | |
| "<details>\n<summary>Show details</summary>\n\n", | |
| "| File | Line | Col | Message |\n", | |
| "| --- | --- | --- | --- |\n") | |
| for (l in lints) { | |
| msg <- gsub("\\|", "\\\\|", l$message) | |
| msg <- gsub("\n", " ", msg) | |
| parts <- c(parts, sprintf("| `%s` | %s | %s | %s |\n", | |
| l$filename, | |
| if (is.null(l$line_number)) 1 else l$line_number, | |
| if (is.null(l$column_number)) 1 else l$column_number, | |
| msg)) | |
| } | |
| parts <- c(parts, "\n</details>\n\n") | |
| } | |
| cat(paste(parts, collapse = ""), file = gh_sum, append = TRUE) | |
| } | |
| shell: Rscript {0} | |
| - name: "\U0001F524 Spell check (spelling)" | |
| if: env.run_spelling == 'true' && runner.os == 'Linux' | |
| continue-on-error: ${{ true }} | |
| run: | | |
| options(crayon.enabled = TRUE) | |
| if(!require("spelling", quietly=TRUE)) install.packages("spelling") | |
| mis <- tryCatch(spelling::spell_check_package(), | |
| error = function(e){ | |
| message("spelling failed: ", conditionMessage(e)) | |
| data.frame(word=character(), found=I(list())) | |
| }) | |
| message(sprintf("**** Found %d misspelled word(s) ****", nrow(mis))) | |
| if (nrow(mis) > 0) { | |
| for (i in seq_len(nrow(mis))) { | |
| for (loc in mis$found[[i]]) { | |
| parts <- strsplit(loc, ":", fixed = TRUE)[[1]] | |
| file <- parts[1] | |
| line <- if (length(parts) > 1) parts[2] else "1" | |
| cat(sprintf("::warning file=%s,line=%s::[spelling] possible misspelling: %s\n", | |
| file, line, mis$word[i])) | |
| } | |
| } | |
| } | |
| gh_sum <- Sys.getenv("GITHUB_STEP_SUMMARY") | |
| if (nzchar(gh_sum)) { | |
| parts <- "## π€ Spell check results\n\n" | |
| if (nrow(mis) == 0) { | |
| parts <- c(parts, "No misspellings found β \n\n") | |
| } else { | |
| parts <- c(parts, sprintf("**Found %d misspelled word(s)**\n\n", nrow(mis)), | |
| "<details>\n<summary>Show details</summary>\n\n", | |
| "| Word | Locations |\n| --- | --- |\n") | |
| for (i in seq_len(nrow(mis))) { | |
| locs <- paste(sprintf("`%s`", mis$found[[i]]), collapse = ", ") | |
| parts <- c(parts, sprintf("| `%s` | %s |\n", mis$word[i], locs)) | |
| } | |
| parts <- c(parts, "\n</details>\n\n") | |
| } | |
| cat(paste(parts, collapse = ""), file = gh_sum, append = TRUE) | |
| } | |
| shell: Rscript {0} | |
| - name: "\U0001F6E0 Install package οΈ" | |
| if: env.run_pkgdown == 'true' && runner.os == 'Linux' | |
| env: | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: R CMD INSTALL . | |
| shell: bash {0} | |
| - name: βΉοΈ Get R package info | |
| if: runner.os == 'Linux' | |
| env: | |
| dockerRegistry: ${{ env.docker_registry }} | |
| dockerOrg: ${{ env.docker_org }} | |
| dockerUser: ${{ env.docker_user }} | |
| DOCKER_TOKEN: ${{ env.DOCKER_TOKEN }} | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| #### Docker repos must be lowercase (,,) #### | |
| ## NOTE: Bash cannot interpret variables with "." in them when trying to | |
| ## string manipulation (e.g. making lowercase with ",,"). | |
| ## So use "GITHUB_REPOSITORY_OWNER" instead of "github.repository_owner", | |
| ## or store the variable as an intermediate variable without "." in it. | |
| ## Also be sure to exclude any surrounding spaces inside the "{}" when using ",,". | |
| packageNameOrig=$(grep '^Package:' DESCRIPTION | cut -d\ -f2) | |
| echo "packageName=${packageNameOrig,,}" >> $GITHUB_ENV | |
| echo "packageNameOrig=${packageNameOrig}" >> $GITHUB_ENV | |
| version=$(grep Version DESCRIPTION | grep -o "[0-9.]\+") | |
| echo "packageVersion=${version}" >> $GITHUB_ENV | |
| echo "BASE_IMAGE=${{ matrix.config.cont }}" >> $GITHUB_ENV | |
| #### Adjust docker args depending on docker_registry #### | |
| if [[ $dockerRegistry == "docker.io" ]]; then | |
| echo "dockerOrg=${dockerOrg,,}" >> $GITHUB_ENV | |
| echo "dockerUser=${dockerUser}" >> $GITHUB_ENV | |
| echo "dockerPass=${DOCKER_TOKEN}" >> $GITHUB_ENV; | |
| else | |
| echo "dockerOrg=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV | |
| echo "dockerUser=${GITHUB_ACTOR}" >> $GITHUB_ENV | |
| echo "dockerPass=${GITHUB_TOKEN}" >> $GITHUB_ENV; | |
| fi | |
| shell: bash {0} | |
| - name: "\U0001F4E6 Render README" | |
| if: env.run_pkgdown == 'true' && runner.os == 'Linux' | |
| env: | |
| DISPLAY: 99.0 | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| if(file.exists("README.Rmd")){ | |
| options(crayon.enabled = TRUE) | |
| if(!require("rmarkdown", quietly=TRUE)) install.packages("rmarkdown"); | |
| if(!require("rworkflows", quietly=TRUE)) remotes::install_github("neurogenomics/rworkflows"); | |
| rmarkdown::render("README.Rmd", output_format = rmarkdown::github_document(html_preview = FALSE)); | |
| } | |
| shell: Rscript {0} | |
| - name: "\U0001F4E6 Build pkgdown site" | |
| if: env.run_pkgdown == 'true' && runner.os == 'Linux' | |
| env: | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| options(crayon.enabled = TRUE) | |
| pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | |
| shell: Rscript {0} | |
| - name: "\U0001F4E6\U0001F680 Deploy pkgdown site to GitHub pages" | |
| if: env.run_pkgdown == 'true' && runner.os == 'Linux' | |
| uses: JamesIves/github-pages-deploy-action@releases/v4 | |
| with: | |
| clean: ${{ false }} | |
| branch: gh-pages | |
| folder: docs | |
| token: ${{ env.GITHUB_TOKEN }} | |
| - name: β« Upload check results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r | |
| }}-results | |
| path: check | |
| - name: "\U0001F433βοΈ Create Docker file" | |
| if: | | |
| (!contains(github.event.head_commit.message, '[nodocker]')) && env.run_docker == 'true' && runner.os == 'Linux' | |
| env: | |
| BASE_IMAGE: ${{ matrix.config.cont }} | |
| GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
| run: | | |
| options(crayon.enabled = TRUE) | |
| if(!require("rworkflows", quietly=TRUE)) remotes::install_github("neurogenomics/rworkflows") | |
| path <- rworkflows::use_dockerfile(base_image=Sys.getenv("BASE_IMAGE")) | |
| shell: Rscript {0} | |
| - name: "\U0001F433β¬οΈ Set up Docker" | |
| if: | | |
| (!contains(github.event.head_commit.message, '[nodocker]')) && env.run_docker == 'true' && runner.os == 'Linux' | |
| run: | | |
| sudo apt-get install -y docker.io | |
| shell: bash {0} | |
| - name: "\U0001F433\U0001F512 Login to Docker Registry" | |
| if: | | |
| (!contains(github.event.head_commit.message, '[nodocker]')) && env.run_docker == 'true' && runner.os == 'Linux' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.docker_registry }} | |
| username: ${{ env.dockerUser }} | |
| password: ${{ env.dockerPass }} | |
| - name: "\U0001F433βοΈ Setup Docker Buildx" | |
| if: | | |
| (!contains(github.event.head_commit.message, '[nodocker]')) && env.run_docker == 'true' && runner.os == 'Linux' | |
| uses: docker/setup-buildx-action@v3 | |
| - name: "\U0001F433\U0001F680 Build and Push to Docker Registry" | |
| if: | | |
| (!contains(github.event.head_commit.message, '[nodocker]')) && env.run_docker == 'true' && runner.os == 'Linux' | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: '.' | |
| file: ./Dockerfile | |
| push: ${{ true }} | |
| tags: | | |
| ${{ env.docker_registry }}/${{ env.dockerOrg }}/${{ env.packageName }}:${{ env.packageVersion }}, | |
| ${{ env.docker_registry }}/${{ env.dockerOrg }}/${{ env.packageName }}:latest | |
| build-args: | | |
| PKG=${{ env.packageNameOrig }}, | |
| BASE_IMAGE=${{ matrix.config.cont }} | |
| secrets: | | |
| GITHUB_TOKEN=${{ env.GITHUB_TOKEN }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |