Prepare for 3.20 release #151
Workflow file for this run
This file contains 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
## This is a simplified action for building and testing a Bioconductor package | |
## based on: | |
## * https://github.com/lcolladotor/biocthis/blob/master/actions/check-bioc.yml | |
## * https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml | |
## * https://github.com/seandavi/BuildABiocWorkshop2020/blob/master/.github/workflows/basic_checks.yaml | |
name: R-CMD-check-bioc | |
## Specify which branches to run on | |
## The "devel" branch corresponds to Bioc-devel and "RELEASE_X" branches are | |
## Bioconductor releases. See http://bioconductor.org/developers/how-to/git/. | |
on: | |
push: | |
branches: | |
- devel | |
- 'RELEASE_*' | |
- ci | |
pull_request: | |
branches: | |
- devel | |
- 'RELEASE_*' | |
- ci | |
jobs: | |
get-bioc-release: | |
# Identify the Bioconductor release from the git branch. Also specifies a | |
# Bioconductor Docker image to use. | |
runs-on: ubuntu-latest | |
outputs: | |
biocimage: ${{ steps.get-release.outputs.biocimage }} | |
biocrelease: ${{ steps.get-release.outputs.biocrelease }} | |
steps: | |
- id: get-release | |
name: Get Bioconductor release | |
run: | | |
if echo "$GITHUB_REF" | grep -q "RELEASE_"; then | |
biocrelease="$(basename -- $GITHUB_REF | tr '[:upper:]' '[:lower:]')" | |
else | |
biocrelease="devel" | |
fi | |
biocimage="bioconductor/bioconductor_docker:${biocrelease}" | |
echo "Bioc release: ${biocrelease}" | |
echo "Bioc docker image: {$biocimage}" | |
## Store the information | |
echo "biocimage=${biocimage}" >> $GITHUB_OUTPUT | |
echo "biocrelease=${biocrelease}" >> $GITHUB_OUTPUT | |
get-bioc-version: | |
# Identify the Bioconductor version number and R version to use. This is | |
# done by checking the versions in the Bioconductor Docker container | |
# selected by get-bioc-release. | |
runs-on: ubuntu-latest | |
needs: get-bioc-release | |
container: | |
image: ${{ needs.get-bioc-release.outputs.biocimage }} | |
outputs: | |
Rversion: ${{ steps.set-versions.outputs.rversion }} | |
biocversion: ${{ steps.set-versions.outputs.biocversion }} | |
steps: | |
- id: get-versions | |
name: Get Bioconductor/R versions | |
run: | | |
biocconfig <- "https://bioconductor.org/config.yaml" | |
biocrelease <- "${{ needs.get-bioc-release.outputs.biocrelease }}" | |
cat("Bioc release RAW: ", biocrelease, "\n") | |
biocrelease <- ifelse( | |
grepl(biocrelease, "release"), | |
"release", "devel" | |
) | |
biocmap <- BiocManager:::.version_map_get_online(biocconfig) | |
biocversion <- subset(biocmap, BiocStatus == biocrelease)[, 'Bioc'] | |
rversion <- subset(biocmap, BiocStatus == biocrelease)[, 'R'] | |
writeLines(as.character(c(biocversion, rversion)), | |
"versions.txt") | |
cat("GET VERSIONS", "\n") | |
cat("Bioc release: ", biocrelease, "\n") | |
cat("Bioc version: ", as.character(biocversion), "\n") | |
cat("R version: ", as.character(rversion), "\n") | |
shell: Rscript {0} | |
- id: set-versions | |
name: Set Bioconductor/R versions | |
run: | | |
biocversion=$(head -n 1 versions.txt) | |
rversion=$(tail -n 1 versions.txt) | |
echo "SET VERSIONS" | |
echo "Bioc version: ${biocversion}" | |
echo "R version: ${rversion}" | |
## Store the information | |
echo "biocversion=${biocversion}" >> $GITHUB_OUTPUT | |
echo "rversion=${rversion}" >> $GITHUB_OUTPUT | |
R-CMD-check-docker: | |
## Run checks in the Bioconductor Docker container | |
name: ubuntu-latest (r-biocdocker bioc-${{ needs.get-bioc-version.outputs.biocversion }}) | |
needs: [get-bioc-release, get-bioc-version] | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.get-bioc-release.outputs.biocimage }} | |
volumes: | |
- /home/runner/work/_temp/Library:/usr/local/lib/R/host-site-library | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_BIOC_VERSION: ${{ needs.get-bioc-version.outputs.biocversion }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install extra linux dependencies | |
run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev devscripts qpdf | |
- name: Setup R dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
cache-version: 3 | |
extra-packages: any::rcmdcheck | |
needs: check | |
# Fixes https://github.com/Bioconductor/bioconductor_docker/issues/22 | |
- name: Manually install preprocessCore | |
run: | | |
install.packages( | |
"preprocessCore", | |
repos = BiocManager::repositories(), | |
type = "source", | |
configure.args = "--disable-threading" | |
) | |
shell: Rscript {0} | |
- name: Show session info | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} | |
- name: Check R package | |
uses: r-lib/actions/check-r-package@v2 | |
with: | |
upload-snapshots: true | |
upload-results: true | |
- name: BiocCheck | |
run: | | |
BiocManager::install("BiocCheck") | |
BiocCheck::BiocCheck( | |
dir('check', 'tar.gz$', full.names = TRUE), | |
`no-check-R-ver` = TRUE, | |
`no-check-bioc-help` = TRUE | |
) | |
shell: Rscript {0} | |
R-CMD-check: | |
## Run checks on other platforms. | |
name: ${{ matrix.config.os }} (r-${{ needs.get-bioc-version.outputs.rversion }} bioc-${{ needs.get-bioc-version.outputs.biocversion }}) | |
needs: [get-bioc-release, get-bioc-version] | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
experimental: [true] | |
config: | |
- {os: windows-latest} | |
- {os: macOS-latest} | |
- {os: ubuntu-20.04, rspm: "https://packagemanager.posit.co/cran/__linux__/focal/latest"} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
RSPM: ${{ matrix.config.rspm }} | |
R_BIOC_VERSION: ${{ needs.get-bioc-version.outputs.biocversion }} | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ needs.get-bioc-version.outputs.rversion }} | |
use-public-rspm: true | |
- name: Setup R dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
cache-version: 3 | |
extra-packages: any::rcmdcheck | |
needs: check | |
- name: Session info | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} | |
- name: Check R package | |
uses: r-lib/actions/check-r-package@v2 | |
with: | |
upload-snapshots: true | |
upload-results: true | |
test-coverage: | |
## Calculate package test coverage. Only runs if R-CMD-check-docker has | |
## completed successfully. Uses the Bioconductor Docker image. | |
if: github.ref == 'refs/heads/devel' | |
needs: [get-bioc-release, get-bioc-version, R-CMD-check-docker] | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.get-bioc-release.outputs.biocimage }} | |
volumes: | |
- /home/runner/work/_temp/Library:/usr/local/lib/R/host-site-library | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_BIOC_VERSION: ${{ needs.get-bioc-version.outputs.biocversion }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install extra linux dependencies | |
run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev devscripts qpdf | |
- name: Set Bioconductor version | |
run: | | |
install.packages("BiocManager") | |
BiocManager::install(version = Sys.getenv("BIOCVERSION"), ask = FALSE) | |
shell: Rscript {0} | |
- name: Setup R dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
cache-version: 3 | |
extra-packages: any::covr | |
needs: coverage | |
# Fixes https://github.com/Bioconductor/bioconductor_docker/issues/22 | |
- name: Manually install preprocessCore | |
run: | | |
install.packages( | |
"preprocessCore", | |
repos = BiocManager::repositories(), | |
type = "source", | |
configure.args = "--disable-threading" | |
) | |
shell: Rscript {0} | |
- name: Test coverage | |
run: covr::codecov(quiet = FALSE) | |
shell: Rscript {0} | |
pkgdown: | |
## Build pkgdown site and push to gh-pages branch. Only runs if on the | |
## devel branch and R-CMD-check-docker has completed successfully. Uses | |
## the Bioconductor Docker image. | |
if: github.ref == 'refs/heads/devel' | |
needs: [get-bioc-release, get-bioc-version, R-CMD-check-docker] | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.get-bioc-release.outputs.biocimage }} | |
volumes: | |
- /home/runner/work/_temp/Library:/usr/local/lib/R/host-site-library | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_BIOC_VERSION: ${{ needs.get-bioc-version.outputs.biocversion }} | |
steps: | |
- name: Set git credentials | |
## Assign commits to the GitHub Action user. This should happen | |
## automatically but doesn't (maybe because of Docker). | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
shell: bash {0} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install extra linux dependencies | |
run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev devscripts qpdf | |
- name: Setup R dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
cache-version: 3 | |
extra-packages: any::pkgdown, local::. | |
needs: website | |
# Fixes https://github.com/Bioconductor/bioconductor_docker/issues/22 | |
- name: Manually install preprocessCore | |
run: | | |
install.packages( | |
"preprocessCore", | |
repos = BiocManager::repositories(), | |
type = "source", | |
configure.args = "--disable-threading" | |
) | |
shell: Rscript {0} | |
- name: Build pkgdown site | |
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | |
shell: Rscript {0} | |
- name: Deploy to GitHub pages 🚀 | |
if: github.event_name != 'pull_request' | |
uses: JamesIves/github-pages-deploy-action@4.1.4 | |
with: | |
clean: false | |
branch: gh-pages | |
folder: docs |