-
Notifications
You must be signed in to change notification settings - Fork 15
/
azure-pipelines.yml
67 lines (64 loc) · 2.11 KB
/
azure-pipelines.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
# The following pipeline tests policytree in the following way:
# 1. With the latest R release on Ubuntu/OSX.
# 2. With Valgrind on Linux
# The R setup here is based on https://eddelbuettel.github.io/r-ci/
trigger:
- master
jobs:
- job: R_package
strategy:
matrix:
ubuntu:
imageName: "ubuntu-latest"
macos:
imageName: "macOS-latest"
cppVer: "CXX20"
macos_cpp11:
imageName: "macOS-latest"
cppVer: "CXX11"
pool:
vmImage: $(imageName)
variables:
- name: R_LIBS_USER
value: '$(Agent.BuildDirectory)/R/library'
- name: CRAN
value: 'https://cloud.r-project.org'
- name: _R_CHECK_FORCE_SUGGESTS_
value: false
- name: _R_CHECK_DONTTEST_EXAMPLES_
value: true
- name: USE_BSPM
value: true
- name: WARNINGS_ARE_ERRORS
value: true
steps:
- script: |
sudo apt-get update -qq
sudo apt-get install -qq valgrind
displayName: Setup valgrind
condition: eq(variables['Agent.OS'], 'Linux')
- script: |
echo CXX_STD = $(cppVer) >> Makevars
workingDirectory: r-package/policytree/src
displayName: Specify CXX_STD in R Makevars
condition: ne(variables['Agent.OS'], 'Linux')
- script: |
curl -OLs https://eddelbuettel.github.io/r-ci/run.sh && chmod 0755 run.sh
./run.sh bootstrap
./run.sh install_deps
workingDirectory: r-package/policytree
displayName: Setup R
- script: ./run.sh run_tests
workingDirectory: r-package/policytree
displayName: Test R package
- script: ./run.sh dump_logs_by_extension "fail"
condition: failed()
workingDirectory: r-package/policytree
displayName: Print R failures
- script: |
# Use R check's installation instead of reinstalling the package.
sudo sed -i.old '1s;^;.libPaths(c(file.path(getwd(), "policytree.Rcheck"), .libPaths()));' tests/valgrind/test_policy_tree_valgrind.R
R -d "valgrind --tool=memcheck --leak-check=full --error-exitcode=1" --vanilla < tests/valgrind/test_policy_tree_valgrind.R
workingDirectory: r-package/policytree
displayName: Valgrind check
condition: eq(variables['Agent.OS'], 'Linux')