Skip to content

Commit

Permalink
Added actions to run check and build docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Apr 24, 2024
1 parent 9386732 commit 6b06a92
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
^\\.gitignore$
^\.gitignore$
^\.github$
55 changes: 55 additions & 0 deletions .github/workflows/build-pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
push:
branches:
- master
workflow_dispatch:

name: Build pkgdown

jobs:
build:
name: Build pkgdown
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel

steps:
- uses: actions/checkout@v3

- run: |
sudo apt-get update
sudo apt-get install -y rsync
- uses: r-lib/actions/setup-pandoc@v2

- name: Set directories
run: |
echo "R_PKG_DIR=${R_HOME}/site-library" >> $GITHUB_ENV
- name: Restore the package directory
uses: actions/cache@v3
with:
path: ${{ env.R_PKG_DIR }}
key: pkgdown-packages

- name: Install dependencies
shell: Rscript {0}
run: |
stuff <- read.dcf("DESCRIPTION")
stuff <- stuff[,intersect(colnames(stuff), c("Imports", "LinkingTo", "Suggests", "Depends"))]
deps <- sub(" .*", "", unlist(strsplit(stuff, ",\\s*"), use.names=FALSE))
BiocManager::install(c("pkgdown", deps))
- name: Install self
run: R CMD INSTALL .

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
branch: gh-pages
folder: docs

42 changes: 42 additions & 0 deletions .github/workflows/r-cmd-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
branches:
- master
pull_request:

name: R CMD check

jobs:
check:
name: R CMD check
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel

steps:
- uses: actions/checkout@v3

- name: Set directories
run: |
echo "R_PKG_DIR=${R_HOME}/site-library" >> $GITHUB_ENV
- name: Restore the package directory
uses: actions/cache@v3
with:
path: ${{ env.R_PKG_DIR }}
key: check-packages

- name: Install dependencies
shell: Rscript {0}
run: |
stuff <- read.dcf("DESCRIPTION")
stuff <- stuff[,intersect(colnames(stuff), c("Imports", "LinkingTo", "Suggests", "Depends"))]
deps <- sub(" .*", "", unlist(strsplit(stuff, ",\\s*"), use.names=FALSE))
BiocManager::install(deps)
- name: Build the package
run: R CMD build .

- name: Check the package
run: |
tarball=$(ls *.tar.gz)
R CMD check --no-manual $tarball

0 comments on commit 6b06a92

Please sign in to comment.