-
Notifications
You must be signed in to change notification settings - Fork 6
/
circle.yml
70 lines (58 loc) · 1.74 KB
/
circle.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
defaults: &steps
steps:
- checkout
## setup -------------------------------
- run:
name: Set environmental variables
command: |
Rscript --vanilla \
-e 'dsc <- read.dcf("DESCRIPTION")' \
-e 'cat(sprintf("export PKG_TARBALL=%s_%s.tar.gz\n", dsc[,"Package"], dsc[,"Version"]))' \
-e 'cat(sprintf("export RCHECK_DIR=%s.Rcheck\n", dsc[,"Package"]))' \
>> ${BASH_ENV}
## install dependencies ------------------
- run:
name: Install devtools and dependencies
command: |
Rscript \
-e 'if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")' \
-e 'devtools::install_deps(dependencies = TRUE)'
## build and test -----------------
- run:
name: Build package
command: R CMD build .
- run:
name: Check package
command: R CMD check "${PKG_TARBALL}" --as-cran --no-manual
- run:
name: Check failures
command: |
Rscript -e "message(devtools::check_failures(path = '${RCHECK_DIR}'))"
# warnings are errors
# - run: if grep -q -R "WARNING" "${RCHECK_DIR}/00check.log"; then exit 1; fi
## store artifacts -----------------
- run:
command: mv ${RCHECK_DIR} /tmp/Rcheck
when: always
- store_test_results:
path: /tmp/Rcheck/tests/
when: always
- store_artifacts:
path: /tmp/Rcheck
when: always
version: 2
jobs:
"r-release":
docker:
- image: rocker/tidyverse:latest
<<: *steps
"r-devel":
docker:
- image: rocker/tidyverse:devel
<<: *steps
workflows:
version: 2
build_and_test:
jobs:
- "r-release"
- "r-devel"