-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GitHub actions instead of Travis (#396)
* Add R-CMD-check and linting workflows * Update CI login helper functions Rather than checking whether they run on travis, check whether they're run on CI. Both travis and github actions have a "CI" env var set to "true". * Use API key from secret * Remove .travis.yml * Try different way to get python packages installed * Update .Rprofile to check for CI Also removes repos; we don't use synapser anymore so I don't think this is needed * Turn off reticulate autoconfigure * Put CRAN mirror back * Put synapseclient name in quotes
- Loading branch information
Showing
6 changed files
with
164 additions
and
52 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,12 +1,11 @@ | ||
.First <- function() { | ||
options( | ||
repos = c( | ||
CRAN = "https://cran.rstudio.com/", | ||
Sage = "http://ran.synapse.org" | ||
CRAN = "https://cran.rstudio.com/" | ||
) | ||
) | ||
} | ||
|
||
if (!identical(Sys.getenv("TRAVIS"), "true")) { # don't run on travis | ||
if (!identical(Sys.getenv("CI"), "true")) { # don't run on travis | ||
source("renv/activate.R") | ||
} |
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,105 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
name: R-CMD-check | ||
|
||
jobs: | ||
R-CMD-check: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: macOS-latest, r: 'devel'} | ||
- {os: macOS-latest, r: 'release'} | ||
- {os: windows-latest, r: 'release'} | ||
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} | ||
- {os: ubuntu-16.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} | ||
- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} | ||
- {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} | ||
|
||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
SYNAPSE_USER: ${{ secrets.SYNAPSE_USER }} | ||
SYNAPSE_APIKEY: ${{ secrets.SYNAPSE_APIKEY }} | ||
RETICULATE_AUTOCONFIGURE: 'FALSE' | ||
|
||
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), "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('depends.Rds') }} | ||
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}- | ||
|
||
- name: Install system dependencies (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get -y update | ||
sudo apt-get install -y make python-minimal pandoc pandoc-citeproc git-core libv8-dev libxml2-dev libcurl4-openssl-dev libssl-dev libssh2-1-dev zlib1g-dev | ||
- name: Install system dependencies (macOS) | ||
if: runner.os == 'macOS' && matrix.config.r == 'devel' | ||
run: | | ||
brew install V8 | ||
- name: Install dependencies | ||
run: | | ||
library(remotes) | ||
deps <- readRDS("depends.Rds") | ||
deps[["installed"]] <- vapply(deps[["package"]], remotes:::local_sha, character(1)) | ||
update(deps) | ||
remotes::install_cran("rcmdcheck") | ||
shell: Rscript {0} | ||
|
||
- name: Install Miniconda | ||
run: | | ||
Rscript -e "remotes::install_github('rstudio/reticulate')" | ||
Rscript -e "reticulate::install_miniconda()" | ||
- name: Add Miniconda to .Rprofile on macOS | ||
if: runner.os == 'macOS' | ||
run: echo "options(reticulate.conda_binary = reticulate:::miniconda_conda())" >> .Rprofile | ||
|
||
- name: Install Python deps | ||
run: | | ||
Rscript -e "reticulate::conda_create('r-reticulate', packages = c('python==3.7.0'))" | ||
Rscript -e "remotes::install_local()" | ||
Rscript -e "reticulate::py_install('pandas', pip = TRUE)" | ||
Rscript -e "reticulate::py_install('synapseclient', pip = TRUE)" | ||
- name: Check | ||
run: rcmdcheck::rcmdcheck(args = "--no-manual", 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 |
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,44 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
name: lint | ||
|
||
jobs: | ||
lint: | ||
runs-on: macOS-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@master | ||
|
||
- name: Query dependencies | ||
run: | | ||
install.packages('remotes') | ||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | ||
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | ||
shell: Rscript {0} | ||
|
||
- name: Cache R packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} | ||
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- | ||
|
||
- name: Install dependencies | ||
run: | | ||
install.packages(c("remotes")) | ||
remotes::install_deps(dependencies = TRUE) | ||
remotes::install_cran("lintr") | ||
shell: Rscript {0} | ||
|
||
- name: Lint | ||
run: lintr::lint_package() | ||
shell: Rscript {0} |
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