-
Notifications
You must be signed in to change notification settings - Fork 250
/
azure-pipelines.yml
106 lines (103 loc) · 3.21 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
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
99
100
101
102
103
104
105
106
# The following pipeline tests grf in the following ways:
# 1. Core C++ compiled with GCC and test with valgrind on latest Ubuntu.
# 2. Core C++ compiled with Clang and test with valgrind on latest Ubuntu.
# 3. Core C++ compiled with MSVC (release build with all optimizations).
# 4. Latest R release on Ubuntu(+ small valgrind check)/MacOS.
# The R setup here is based on https://eddelbuettel.github.io/r-ci/
trigger:
- master
jobs:
- job: coreCPP
pool:
vmImage: "ubuntu-20.04" # bundled valgrind in ubuntu-latest breaks with clang (update to latest when available).
strategy:
matrix:
clang:
CXX: clang++
gcc:
CXX: g++
steps:
- script: |
sudo apt-get update -qq
sudo apt-get install -qq valgrind
displayName: Setup
- script: |
mkdir build && cd build
cmake -DCMAKE_CXX_COMPILER=$CXX .. && make debug
workingDirectory: core
displayName: Build
- script: valgrind --leak-check=full --error-exitcode=1 ./build/grf
workingDirectory: core
displayName: Valgrind check
- job: coreCPP_MSVC
pool:
vmImage: "windows-latest"
steps:
- script: |
mkdir build && cd build
cmake -DCMAKE_CXX_COMPILER=CL.exe ..
workingDirectory: core
displayName: CMake
- task: VSBuild@1
inputs:
solution: 'core\build\*.sln'
configuration: 'release'
displayName: Build
- script: build\Release\grf.exe
workingDirectory: core
displayName: Check
- 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: 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/grf/bindings
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_all
workingDirectory: r-package/grf
displayName: Setup R
- script: ./run.sh run_tests
workingDirectory: r-package/grf
displayName: Test R package
- script: ./run.sh dump_logs_by_extension "fail"
condition: failed()
workingDirectory: r-package/grf
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(), "grf.Rcheck"), .libPaths()));' tests/valgrind/test_grf_valgrind.R
R -d "valgrind --tool=memcheck --leak-check=full --error-exitcode=1" --vanilla < tests/valgrind/test_grf_valgrind.R
workingDirectory: r-package/grf
displayName: Valgrind check
condition: eq(variables['Agent.OS'], 'Linux')