Resolve a similar issue with links on Google Chrome to https://github… #59
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
## Read more about GitHub actions the features of this GitHub Actions workflow | |
## at https://lcolladotor.github.io/biocthis/articles/biocthis.html#use_bioc_github_action | |
## | |
## For more details, check the biocthis developer notes vignette at | |
## https://lcolladotor.github.io/biocthis/articles/biocthis_dev_notes.html | |
## | |
## You can add this workflow to other packages using: | |
## > biocthis::use_bioc_github_action() | |
## or | |
## > usethis::use_github_action("check-bioc", "https://bit.ly/biocthis_gha", "check-bioc.yml") | |
## without having to install biocthis. | |
## | |
## Using GitHub Actions exposes you to many details about how R packages are | |
## compiled and installed in several operating system.s | |
### If you need help, please follow the steps listed at | |
## https://github.com/r-lib/actions#where-to-find-help | |
## | |
## If you found an issue specific to biocthis's GHA workflow, please report it | |
## with the information that will make it easier for others to help you. | |
## Thank you! | |
## Acronyms: | |
## * GHA: GitHub Action | |
## * OS: operating system | |
## Specify which branches you want this GHA to run on. | |
## Bioconductor uses branches such as master (bioc-devel) and RELEASE_* like | |
## RELEASE_3_10. For more details check | |
## http://bioconductor.org/developers/how-to/git/ | |
on: | |
push: | |
branches: | |
- master | |
- 'RELEASE_*' | |
pull_request: | |
branches: | |
- master | |
- 'RELEASE_*' | |
name: R-CMD-check-bioc | |
## These environment variables control whether to run GHA code later on that is | |
## specific to testthat, covr, and pkgdown. | |
## | |
## If you need to clear the cache of packages, update the number inside | |
## cache-version as discussed at https://github.com/r-lib/actions/issues/86. | |
## Note that you can always run a GHA test without the cache by using the word | |
## "/nocache" in the commit message. | |
env: | |
cache-version: 'cache-v1' | |
jobs: | |
## This first job uses the GitHub repository branch name to infer what | |
## version of Bioconductor we will be working on. | |
define-docker-info: | |
runs-on: ubuntu-latest | |
outputs: | |
imagename: ${{ steps.findinfo.outputs.imagename }} | |
biocversion: ${{ steps.findinfo.outputs.biocversion }} | |
steps: | |
- id: findinfo | |
run: | | |
## Find what Bioconductor RELEASE branch we are working on | |
## otherwise, assume we are working on bioc-devel. | |
if echo "$GITHUB_REF" | grep -q "RELEASE_"; then | |
biocversion="$(basename -- $GITHUB_REF | tr '[:upper:]' '[:lower:]')" | |
else | |
biocversion="devel" | |
fi | |
## Define the image name and print the information | |
imagename="bioconductor/bioconductor_docker:${biocversion}" | |
echo $imagename | |
echo $biocversion | |
## Save the information for the next job | |
echo "::set-output name=imagename::${imagename}" | |
echo "::set-output name=biocversion::${biocversion}" | |
R-CMD-check-bioc: | |
## This job then checks the R package using the Bioconductor docker that | |
## was defined by the previous job. This job will determine what version of | |
## R to use for the macOS and Windows builds on the next job. | |
runs-on: ubuntu-latest | |
needs: define-docker-info | |
## Name shown on the GHA log | |
name: ubuntu-latest (r-biocdocker bioc-${{ needs.define-docker-info.outputs.biocversion }}) | |
## Information used by the next job that will run on macOS and Windows | |
outputs: | |
rversion: ${{ steps.findrversion.outputs.rversion }} | |
biocversionnum: ${{ steps.findrversion.outputs.biocversionnum }} | |
## Environment variables unique to this job. | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
TZ: UTC | |
NOT_CRAN: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
## The docker container to use. Note that we link a directory on the GHA | |
## runner to a docker directory, such that we can then cache the linked | |
## directory. This directory will contain the R packages used. | |
container: | |
image: ${{ needs.define-docker-info.outputs.imagename }} | |
volumes: | |
- /home/runner/work/_temp/Library:/usr/local/lib/R/host-site-library | |
steps: | |
- name: Install latest git | |
run: | | |
## git version provided | |
git --version | |
## to be able to install software properties | |
sudo apt-get update -y | |
## to be able to use add-apt-repository | |
sudo apt-get install software-properties-common -y | |
## to use stable releases of git that are already in a PPA at | |
## https://launchpad.net/~git-core/+archive/ubuntu/candidate | |
sudo add-apt-repository ppa:git-core/candidate -y | |
## Update | |
sudo apt-get update -y | |
## Upgrade git and other tools | |
sudo apt-get upgrade -y | |
## latest git version | |
git --version | |
shell: bash {0} | |
## Related to https://github.com/rocker-org/rocker-versioned2/issues/52 | |
## Most of these steps are the same as the ones in | |
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml | |
## If they update their steps, we will also need to update ours. | |
- uses: actions/checkout@v2 | |
- name: Install R package installers | |
run: | | |
install.packages('remotes') | |
message(paste('****', Sys.time(), 'installing BiocManager ****')) | |
remotes::install_cran("BiocManager") | |
shell: Rscript {0} | |
## Find the corresponding R version based on the Bioconductor version | |
## to use for the macOS and Windows checks by the next GHA job | |
- id: findrversion | |
name: Find Bioc and R versions | |
run: | | |
## Find what branch we are working on | |
if echo "$GITHUB_REF" | grep -q "RELEASE_"; then | |
biocversion="release" | |
else | |
biocversion="devel" | |
fi | |
## Define the R and Bioconductor version numbers | |
biocversionnum=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == '${biocversion}')[, 'Bioc']; cat(as.character(res))") | |
rversion=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == '${biocversion}')[, 'R']; cat(as.character(res))") | |
## Print the results | |
echo $biocversion | |
echo $biocversionnum | |
echo $rversion | |
## Save the info for the next job | |
echo "::set-output name=rversion::${rversion}" | |
echo "::set-output name=biocversionnum::${biocversionnum}" | |
shell: | |
bash {0} | |
- name: Cache R packages | |
if: "!contains(github.event.head_commit.message, '/nocache')" | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/work/_temp/Library | |
key: ${{ env.cache-version }}-${{ runner.os }}-biocdocker-biocbranch-${{ needs.define-docker-info.outputs.biocversion }}-r-${{ steps.findrversion.outputs.rversion }}-bioc-${{ steps.findrversion.outputs.biocversionnum }}-${{ hashFiles('documentation/*Rmd') }} | |
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocdocker-biocbranch-${{ needs.define-docker-info.outputs.biocversion }}-r-${{ steps.findrversion.outputs.rversion }}-bioc-${{ steps.findrversion.outputs.biocversionnum }}- | |
- name: Install dependencies | |
run: | | |
## For building the website & getting the R session info | |
## Edit as necessary with other packages in the future | |
BiocManager::install(c("bookdown", "sessioninfo", "LieberInstitute/recount3", "BiocStyle", "LieberInstitute/megadepth", "purrr", "langmead-lab/snapcount", "postcards")) | |
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: Build website | |
run: | | |
rmarkdown::render("index.Rmd") | |
setwd("docs") | |
bookdown::render_book("index.Rmd") | |
system("touch website/.nojekyll") | |
shell: Rscript {0} | |
- name: Re-arrange files | |
run: | | |
mkdir docs/website | |
mv index.html docs/website/ | |
mv docs/_book docs/website/docs | |
- name: Install deploy dependencies | |
run: | | |
apt-get update && apt-get -y install rsync | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@releases/v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages # The branch the action should deploy to. | |
folder: docs/website # The folder the action should deploy. | |