-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
103 lines (100 loc) · 3.05 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
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/maq/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
./run.sh install_r lpSolve
./run.sh install_r grf
workingDirectory: r-package/maq
displayName: Setup R
- script: ./run.sh run_tests
workingDirectory: r-package/maq
displayName: Test R package
- script: ./run.sh dump_logs_by_extension "fail"
condition: failed()
workingDirectory: r-package/maq
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(), "maq.Rcheck"), .libPaths()));' tests/valgrind/test_maq_valgrind.R
R -d "valgrind --tool=memcheck --leak-check=full --error-exitcode=1" --vanilla < tests/valgrind/test_maq_valgrind.R
workingDirectory: r-package/maq
displayName: Valgrind check
condition: eq(variables['Agent.OS'], 'Linux')
- job: Python_package
strategy:
matrix:
ubuntu:
imageName: "ubuntu-latest"
macos:
imageName: "macOS-latest"
win:
imageName: "windows-latest"
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
- script: |
pip install flake8
flake8 --ignore=E501,W503
workingDirectory: 'python-package'
displayName: 'Run lint'
condition: eq(variables['Agent.OS'], 'Linux')
- script: |
pip install -v .
workingDirectory: 'python-package'
displayName: 'Install Python bindings'
- script: |
pip install numpy pytest
pytest
workingDirectory: 'python-package'
displayName: 'Test Python bindings'
- script: |
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install libomp
pip install -I causalml xgboost matplotlib jupyter
jupyter nbconvert --execute --to 'notebook' introduction.ipynb
workingDirectory: 'python-package/notebooks'
displayName: 'Ensure notebooks run'
condition: eq(variables['Agent.OS'], 'Darwin')