-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
99 lines (91 loc) · 3.33 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
language: R
sudo: false
cache: packages
r:
- release
addons:
apt:
packages:
- ccache
- libglu1-mesa-dev
env:
global:
- _R_CHECK_TIMINGS_=0
- _R_CHECK_FORCE_SUGGESTS_=false
- _R_CHECK_TESTS_NLINES_=999
- NOT_CRAN=true
- MAKEFLAGS="-j 2"
- RGL_USE_NULL=TRUE
before_script:
- rm inst/doc/*.* || true
- Rscript -e 'if (!require("roxygen2")) install.packages("roxygen2")'
- Rscript -e 'if (!require("covr")) install.packages("covr")'
- Rscript -e 'if (!require("pkgdown")) install.packages("pkgdown")'
- Rscript -e 'if (!require("devtools")) install.packages("devtools")'
- Rscript -e 'devtools::document()'
stages:
- test
- name: document
if: branch = mosmafs-package AND type IN (push, api, cron)
jobs:
include:
- stage: test
env: github-mlr
script:
- Rscript -e 'devtools::install_github("berndbischl/BBmisc")'
- Rscript -e 'devtools::install_github("berndbischl/ParamHelpers")'
- Rscript -e 'devtools::install_github("mlr-org/mlr")'
- Rscript -e 'message("INSTALLED PACKS:"); installed.packages()[,2:3]'
- travis_wait 100 R CMD build .
- travis_wait 100 R CMD check mosmafs*.tar.gz --as-cran --run-donttest
- grep -q -R "WARNING" "mosmafs.Rcheck/00check.log" ; [ $? -ne 0 ]
- stage: test
env: cran-mlr
script:
- Rscript -e 'message("INSTALLED PACKS:"); installed.packages()[,2:3]'
- travis_wait 100 R CMD build .
- travis_wait 100 R CMD check mosmafs*.tar.gz --as-cran --run-donttest
- grep -q -R "WARNING" "mosmafs.Rcheck/00check.log" ; [ $? -ne 0 ]
- stage: test
env: cran-mlr
script:
- travis_wait 100 Rscript -e 'covr::codecov(quiet = FALSE)'
- stage: document
env: cran-mlr
script:
- true
before_deploy:
- rm -rf doc | true
- rm -rf inst | true
- travis_wait 100 Rscript -e 'roxygen2::roxygenize(); devtools::install(quick = TRUE); pkgdown::build_site()'
- travis_wait 100 Rscript -e 'tools::buildVignettes(dir = ".")'
- mkdir -p inst/doc
- mv -f vignettes/*.html inst/doc
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
local-dir: docs
on:
branch: mosmafs-package
after_deploy:
- git checkout mosmafs-package # otherwise we're in detached head
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
- git config user.name Travis
- git config user.email '<>'
- git config credential.helper "store --file=.git/credentials"
- echo "https://${GITHUB_TOKEN}:@github.com" >> .git/credentials
- git config push.default matching
- |
git difftool -yx "diff -qI '20[0-9][0-9]-[0-1][0-9]-[0-3][0-9]\\|environment. 0x\\|bytecode. 0x\\|time. [0-9.]\\+'" | \
grep ' and inst/doc' | sed -e 's|.*and inst/doc|inst/doc|' -e 's/ differ$//' | xargs git add
- git ls-files --deleted | grep '^inst/doc/' | xargs git add
- git ls-files --others | grep '^inst/doc/.*\.html$' | xargs git add
- git add --force man/*
- git add DESCRIPTION NAMESPACE
- git commit -m "update auto-generated documentation [ci skip]" || true
- git push
on_success: change
on_failure: always
notifications:
email: false