-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
65 lines (59 loc) · 2.65 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
language: r
r:
- devel
dist: bionic
cache: packages
warnings_are_errors: false
latex: false
# install debian libraries to match R-servers
# update pre-installed packages to latest versions
before_install:
- export R_REMOTES_NO_ERRORS_FROM_WARNINGS="true"
- sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
- sudo apt-get -qq update
- sudo apt-get install -y libgdal-dev libproj-dev python-protobuf libprotoc-dev libprotobuf-dev libv8-dev librsvg2-dev libmpfr-dev libnlopt-dev libharfbuzz-dev libfribidi-dev
- sudo add-apt-repository -y ppa:cran/libgit2
- sudo apt-get -qq update
- sudo apt-get install libgit2-dev
- mkdir -p ~/.R/
- echo "CXXFLAGS = `R CMD config CXXFLAGS` -g0 -flto -w" >> ~/.R/Makevars
- echo "CXX14FLAGS = -w -O3" >> ~/.R/Makevars
- sudo apt-get install -y r-cran-rcppeigen
- rcode="options('testthat.progress.max_fails' = Inf); "
- rcode+="tfile <- tempfile(); capture.output(res<-devtools::test(), file = tfile); out <- readLines(tfile); cat(out, sep = '\n'); "
- rcode+="line.fail <- max(grep('FAIL', out)); "
- rcode+="tmp <- unlist(strsplit(split='[[:space:]]+', out[line.fail])); "
- rcode+="pos.fail <- grep('FAIL', tmp); n.fail <- as.numeric(tmp[pos.fail+1]); "
- rcode+="res <- as.data.frame(res);"
- rcode+="out <- data.frame(fail = res[['failed']] + res[['error']], file = unlist(res[['file']]), warning = unlist(res[['warning']])); "
- rcode+="write.csv(out, file='test_results.csv', row.names = FALSE); "
- rcode+="quit(status = !identical(n.fail, 0), save='no');"
- Rscript tools/travis_run_before_install.R
r_packages:
- devtools
- roxygen2
- covr
r_github_packages:
- Displayr/flipDevTools
script:
- R CMD build --no-manual --no-build-vignettes --no-resave-data .
- R CMD check --as-cran --no-manual --no-build-vignettes --no-tests *.tar.gz
- if [ -d tests/testthat ]; then
Rscript --default-packages='datasets,utils,grDevices,graphics,stats,methods' -e "$rcode";
fi
notifications:
slack:
rooms:
- displayr:FTgSTNHC2rpanhJMGTKMwZXM#github-notifications
template:
- "Build <%{build_url}|#%{build_number}> %{result} in %{repository_name}@%{branch} by %{author}: <%{compare_url}|%{commit_subject}>"
on_success: change
on_failure: always
# Warning notifications and downstream package builds are implemented
# by calling R functions so they can be updated in this package without
# committing a new change to .travis.yml in each repository
after_success:
- Rscript -e "require(flipDevTools); NotifyWarnings(); TriggerDownstreamBuilds()"
- travis_wait Rscript -e "flipDevTools::CheckCoverage()"
after_failure:
- Rscript -e "require(flipDevTools); NotifyWarnings()"