Updated PACKAGE documentation #128
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
on: | |
push: | |
branches: | |
- main | |
- master | |
name: pkgdown | |
jobs: | |
pkgdown: | |
runs-on: macOS-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: macOS-latest, r: 'release', bioc: '3.18'} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Query dependencies | |
run: | | |
install.packages('remotes') | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
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 "master"; then | |
biocversion="devel" | |
elif echo "$GITHUB_REF" | grep -q "RELEASE_"; then | |
biocversion="release" | |
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 "rversion=${rversion}" >> $GITHUB_OUTPUT | |
echo "biocversionnum=${biocversionnum}" >> $GITHUB_OUTPUT | |
# echo "::set-output name=rversion::${rversion}" | |
# echo "::set-output name=biocversionnum::${biocversionnum}" | |
shell: | |
bash {0} | |
- name: Set BiocVersion | |
run: | | |
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE, update = FALSE) | |
shell: Rscript {0} | |
- name: Install dependencies | |
run: | | |
#remotes::install_deps(dependencies = TRUE) | |
install.packages("pkgdown", type = "binary", dependencies = TRUE) | |
## 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]]) | |
BiocManager::install(local_deps, force = TRUE) | |
## 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") | |
shell: Rscript {0} | |
- name: Install package | |
run: R CMD INSTALL . | |
- name: Deploy package | |
run: | | |
git config --local user.email "actions@github.com" | |
git config --local user.name "GitHub Actions" | |
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' |