-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to GitHub Actions for CI and Deployment
Switch to GitHub Actions (GHA) for CI and Deployment. GHA provides a richer build matrix and longer build times than Travis as well as smoother integration. (Additionally, remove AppVeyor which was always a bit flakey). In addition, this branch addresses several bugs identified by the new CI, mainly related to updated tidyverse packages and stricter recycling rules inside if() clauses.
- Loading branch information
Showing
13 changed files
with
192 additions
and
198 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
## CI Files | ||
^.github$ | ||
^codecov\.yml$ | ||
^appveyor\.yml$ | ||
|
||
## RStudio Files | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
|
||
## Pkgdown docs | ||
_pkgdown.yml | ||
^docs$ | ||
^_pkgdown\.yml$ | ||
^pkgdown$ | ||
^.travis\.yml$ | ||
|
||
## GH files (not part of package) | ||
.gitignore.deploy | ||
README.Rmd | ||
README.md | ||
^data-raw$ | ||
|
||
## Other autogenerated files | ||
^README-.*\.png$ | ||
figs/* | ||
build_steps.R | ||
^codecov\.yml$ | ||
|
||
## Misc other files | ||
LICENSE | ||
CONTRIBUTORS | ||
.github/* | ||
^appveyor\.yml$ |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Adapted from https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
name: R-CMD-check and Deploy | ||
|
||
jobs: | ||
R-CMD-check: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: windows-latest, r: '3.6'} | ||
- {os: macOS-latest, r: '3.6'} | ||
- {os: macOS-latest, r: 'devel'} | ||
- {os: ubuntu-16.04, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} | ||
|
||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@master | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
|
||
- uses: r-lib/actions/setup-pandoc@master | ||
|
||
- name: Query dependencies | ||
run: | | ||
install.packages('remotes') | ||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | ||
shell: Rscript {0} | ||
|
||
- name: Cache R packages | ||
if: runner.os != 'Windows' | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }} | ||
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}- | ||
|
||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
env: | ||
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc | ||
run: | | ||
Rscript -e "remotes::install_github('r-hub/sysreqs')" | ||
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") | ||
sudo -s eval "$sysreqs" | ||
- name: Install dependencies | ||
run: | | ||
remotes::install_deps(dependencies = TRUE) | ||
remotes::install_cran(c('rcmdcheck', 'devtools', 'roxygen2', 'testthat', 'markdown', 'knitr', 'rmarkdown', 'pkgdown')) | ||
remotes::install_cran(c('gifski', 'gganimate', 'cvxclustr', 'cvxbiclustr')) | ||
shell: Rscript {0} | ||
|
||
- name: Add auto-generated files | ||
run: | | ||
file.create("NAMESPACE") | ||
cat("# Generated by roxygen2: do not edit by hand", file = "NAMESPACE") | ||
cat("\n\nuseDynLib(clustRviz)", file = "NAMESPACE", append = TRUE) | ||
Rcpp::compileAttributes(verbose = TRUE) | ||
roxygen2::roxygenize() | ||
## Avoid time-out | ||
cat("WRITING TEST STUBS -------- \n\n") | ||
skeleton <- readLines(file.path("tests", "test_stub.R")) | ||
for(f in list.files(file.path("tests", "testthat"), pattern="test_")){ | ||
stub <- gsub("test_(.*)\\.R", "\\1", f) | ||
writeLines(gsub("PATTERN", stub, skeleton), | ||
file.path("tests", paste0("test_", stub, ".R"))) | ||
} | ||
unlink(file.path("tests", "test_stub.R")) | ||
## GitHash for debugging purposes | ||
cat("ADDING GIT HASH -------- \n\n") | ||
if(!dir.exists("inst")){ | ||
dir.create("inst") | ||
} | ||
writeLines(system("git rev-parse HEAD", intern=TRUE), "inst/GIT.HASH") | ||
shell: Rscript {0} | ||
|
||
- name: R CMD check | ||
env: | ||
_R_CHECK_CRAN_INCOMING_REMOTE_: false | ||
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") | ||
shell: Rscript {0} | ||
|
||
- name: Upload check results | ||
if: failure() | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | ||
path: check | ||
|
||
- name: Run coverage | ||
if: success() && matrix.config.os == 'macOS-latest' && matrix.config.r == '3.6' | ||
run: | | ||
remotes::install_cran('covr') | ||
library(covr) | ||
flags <- getOption("covr.flags") | ||
flags[] <- gsub("-O0 ", "", flags) | ||
options(covr.flags=flags) | ||
codecov(quiet=FALSE) | ||
shell: Rscript {0} | ||
|
||
- name: Clean up build artifacts and render pkgdown site | ||
if: success() && matrix.config.os == 'ubuntu-16.04' | ||
run: | | ||
devtools::install() | ||
rmarkdown::render('README.Rmd') | ||
pkgdown::build_site() | ||
unlink('src/*o', force = TRUE) | ||
unlink('*Rcheck', force = TRUE, recursive = TRUE) | ||
unlink('*tar.gz', force = TRUE) | ||
file.rename('.github/.gitignore.deploy', '.gitignore') | ||
## Copy GIF to a place where pkgdown site will find it | ||
dir.create("docs/inst", recursive = TRUE) | ||
file.copy("inst/path_dyn.gif", "docs/inst/path_dyn.gif") | ||
shell: Rscript {0} | ||
|
||
- name: Deploy build package | ||
if: success() && matrix.config.os == 'ubuntu-16.04' && github.ref == 'refs/heads/develop' | ||
run: | | ||
git checkout master || git checkout -b master | ||
git add man/* || echo "No doc changes to commit" | ||
git add R/* || echo "No R code changes to commit" | ||
git add src/* || echo "No C++ code changes to commit" | ||
git add README.md || echo "No README changes to commit" | ||
git add NAMESPACE || echo "No NAMESPACE changes to commit" | ||
git add vignettes/*html || echo "No vignette HTML changes to commit" | ||
git add docs/* || echo "No pkgdown changes to commit" | ||
git add .gitignore || echo "No .gitignore changes to commit" | ||
git config user.email "michael.weylandt@gmail.com" | ||
git config user.name "${{github.actor}} (Auto-Deploy via GitHub Actions)" | ||
git commit -m "Add build artifacts" || echo "No changes to commit" | ||
git push -f -u https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git master || echo "No changes to commit" | ||
This file was deleted.
Oops, something went wrong.
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 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 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 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 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 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
Oops, something went wrong.