Skip to content

Commit

Permalink
Update GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed May 3, 2022
1 parent e77e450 commit 741df36
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 49 deletions.
88 changes: 44 additions & 44 deletions .github/workflows/check-bioc-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ env:
cache-version: 'cache-v1'
run_docker: 'true'

jobs:
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
Expand All @@ -67,14 +67,14 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}
GITHUB_PAT: ${{ secrets.PAT_GITHUB }}
GITHUB_REPO: ${{ github.repository }}
RGL_USE_NULL: TRUE
## Can save variable as GitHub Secret, or manually enter DockerHub
RGL_USE_NULL: TRUE
## Can save variable as GitHub Secret, or manually enter DockerHub
## username here (e.g. "bschilder").
DOCKER_USERNAME: "bschilder"
## Can save variable as GitHub Secret, or manually enter DockerHub
## Can save variable as GitHub Secret, or manually enter DockerHub
## organization name (or simply username) here (e.g. "neurogenomicslab").
DOCKER_ORG: "neurogenomicslab"
DOCKER_ORG: "neurogenomicslab"

steps:
## Set the R library to the directory matching the
## R packages cache step further below when running on Docker (Linux).
Expand All @@ -84,26 +84,26 @@ jobs:
mkdir /__w/_temp/Library
echo ".libPaths('/__w/_temp/Library')" > ~/.Rprofile
## Most of these steps are the same as the ones in
## 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.
- name: Checkout Repository
uses: actions/checkout@v2

# R is already included in the Bioconductor docker image,
# R is already included in the Bioconductor docker image,
# which is only available with Linux as the OS.
- name: Setup R from r-lib
if: runner.os != 'Linux'
uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
http-user-agent: ${{ matrix.config.http-user-agent }}

## pandoc is already included in the Bioconductor docker images
- name: Setup pandoc from r-lib
if: runner.os != 'Linux'
uses: r-lib/actions/setup-pandoc@master
uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
## Required for tcltk
brew install xquartz --cask
## Required for some ggplot2 functions
# brew tap homebrew/cask
# brew tap homebrew/cask-fonts
Expand Down Expand Up @@ -196,8 +196,8 @@ jobs:
## Set the repos source depending on the OS
## Alternatively use https://storage.googleapis.com/bioconductor_docker/packages/
## though based on https://bit.ly/bioc2021-package-binaries
## the Azure link will be the main one going forward.
## the Azure link will be the main one going forward.
bioc_ver <- BiocManager::version()
gha_repos <- if(
.Platform$OS.type == "unix" && Sys.info()["sysname"] != "Darwin"
Expand All @@ -208,15 +208,15 @@ jobs:
## For running the checks
### hrbrthemes necessary to avoid ggplot2 errors on MacOS: https://stackoverflow.com/a/66423481/13214824
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
install.packages(c("rcmdcheck", "BiocCheck","rmarkdown"), repos = gha_repos)
## Pass #1 at installing dependencies
## This pass uses AnVIL-powered fast binaries
## details at https://github.com/nturaga/bioc2021-bioconductor-binaries
## The speed gains only apply to the docker builds.
## The speed gains only apply to the docker builds.
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
remotes::install_local(dependencies = TRUE, repos = gha_repos, build_vignettes = FALSE, upgrade = TRUE)
continue-on-error: true
Expand All @@ -231,13 +231,13 @@ jobs:
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE)
continue-on-error: true
shell: Rscript {0}

- name: Install dependencies pass 3
run: |
## Pass #3 at installing dependencies
## Install via binaries
message(paste('****', Sys.time(), 'pass number 3 at installing dependencies: any remaining dependencies ****'))
remotes::install_local(type = "binary", dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE)
remotes::install_local(type = "binary", dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = FALSE, upgrade = TRUE, force = TRUE)
shell: Rscript {0}

- name: Install BiocGenerics
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
env:
DISPLAY: 99.0
run: |
if(!require("BiocManager")) install.packages("BiocManager")
if(!require("BiocManager")) install.packages("BiocManager")
if(!require("BiocCheck")) BiocManager::install("BiocCheck")
BiocCheck::BiocCheck(
dir('check', 'tar.gz$', full.names = TRUE),
Expand All @@ -321,7 +321,21 @@ jobs:
- name: Install package
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && env.run_pkgdown == 'true' && runner.os == 'Linux'
run: R CMD INSTALL .


- name: Get R package info
if: runner.os == 'Linux'
run: |
#### DockerHub repos must be lowercase (,,) ####
name=$(grep '^Package:' DESCRIPTION | cut -d\ -f2)
echo "packageName=${name,,}" >> $GITHUB_ENV
echo "packageNameOrig=${name}" >> $GITHUB_ENV
echo $name
version=$(grep Version DESCRIPTION | grep -o "[0-9.]\+")
echo "packageVersion=${version}" >> $GITHUB_ENV
echo $version
shell: bash {0}

- name: Render README
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && env.run_pkgdown == 'true' && runner.os == 'Linux'
env:
Expand All @@ -332,13 +346,14 @@ jobs:
rmarkdown::render("README.Rmd", output_format = rmarkdown::github_document(html_preview = FALSE));
}
shell: Rscript {0}

- name: Build and deploy pkgdown site
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && env.run_pkgdown == 'true' && runner.os == 'Linux'
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)"
git config --global --add safe.directory /__w/${{env.packageNameOrig}}/${{env.packageNameOrig}}
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
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
Expand All @@ -350,32 +365,17 @@ jobs:
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-results
path: check
path: check

# DockerHub steps
- name: Get R package info
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && runner.os == 'Linux' "
run: |
#### DockerHub repos must be lowercase (,,) ####
name=$(grep '^Package:' DESCRIPTION | cut -d\ -f2)
echo "packageName=${name,,}" >> $GITHUB_ENV
echo "packageNameOrig=${name}" >> $GITHUB_ENV
echo $name
version=$(grep Version DESCRIPTION | grep -o "[0-9.]\+")
echo "packageVersion=${version}" >> $GITHUB_ENV
echo $version
shell: bash {0}

- name: Build and push to DockerHub
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && runner.os == 'Linux' "
uses: docker/build-push-action@v1
uses: docker/build-push-action@v1
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
repository: ${{ env.DOCKER_ORG }}/${{ env.packageName }}
tag_with_ref: true
tag_with_sha: false
tags: ${{ env.packageVersion }},latest
build_args: PKG=${{ env.packageNameOrig }},BIOC=${{ env.run_bioccheck }}

build_args: PKG=${{ env.packageNameOrig }},BIOC=${{ env.run_bioccheck }}
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MAGMA.Celltyping
Type: Package
Title: Find Causal Cell-Types Underlying Complex Trait Genetics
Version: 2.0.3
Version: 2.0.4
Authors@R:
c(person(given = "Brian",
family = "Schilder",
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# MAGMA.Celltyping 2.0.4

## Bug fixes

* Fix GHA pkgdown building:
- The newest version of [git introduced bugs when building pkgdown sites](https://github.com/actions/checkout/issues/760)
from within Docker containers (e.g. via my Linux GHA workflow).
Adjusting GHA to fix this.

# MAGMA.Celltyping 2.0.3

## Bug fixes
Expand Down
7 changes: 3 additions & 4 deletions man/adjust_zstat_in_genesOut.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 741df36

Please sign in to comment.