-
Notifications
You must be signed in to change notification settings - Fork 8
/
azure-pipelines.yml
104 lines (102 loc) · 4.04 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
variables:
BUNDLES_URL: 'https://portal.ampl.com/dl/amplce/'
LINUX32_BUNDLE_NAME: 'ampl.linux32.tgz'
LINUX64_BUNDLE_NAME: 'ampl.linux64.tgz'
MACOS64_BUNDLE_NAME: 'ampl.macos64.tgz'
MSWIN64_BUNDLE_NAME: 'ampl.mswin64.zip'
stages:
- stage: build
displayName: 'Build'
jobs:
- job: macos
pool: {vmImage: 'macos-latest'}
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9.x'
addToPath: true
- bash: |
set -ex
brew install r
python updatelib.py
bash build.sh
mkdir -p upload/{macos,release,doc}
cp rAMPL_*.tar.gz upload/macos/
cp rAMPL_*.tar.gz upload/release/
cp rAMPL_*.tar.gz upload/release/rAMPL.tar.gz
cp -r docs/build/html upload/doc/R
displayName: Build package
- task: PublishBuildArtifacts@1
inputs: {artifactName: 'drop', pathtoPublish: 'upload'}
- stage: test
displayName: 'Test'
dependsOn: build
jobs:
- job: linux
pool: {vmImage: 'Ubuntu-20.04'}
variables: {AMPL_URL: '$(BUNDLES_URL)/$(LINUX64_BUNDLE_NAME)'}
steps:
- task: DownloadBuildArtifacts@0
inputs: {artifactName: 'drop', downloadPath: '.'}
- bash: cp drop/release/* .
displayName: Copy package
- bash: sudo bash dependencies.sh
displayName: Install Rcpp and testthat
- bash: sudo bash install.sh
displayName: Install package
- bash: bash download-ampl.sh $AMPL_URL
displayName: Install AMPL
- bash: sudo SKIP_BIG_TESTS=1 PATH="`pwd`/ampl:$PATH" bash test.sh
displayName: Test package
- job: macos
pool: {vmImage: 'macos-latest'}
variables: {AMPL_URL: '$(BUNDLES_URL)/$(MACOS64_BUNDLE_NAME)'}
steps:
- task: DownloadBuildArtifacts@0
inputs: {artifactName: 'drop', downloadPath: '.'}
- bash: cp drop/release/* .
displayName: Copy package
- bash: |
set -ex
brew install r
bash dependencies.sh
displayName: Install Rcpp and testthat
- bash: bash install.sh
displayName: Install package
- bash: bash download-ampl.sh $AMPL_URL
displayName: Install AMPL
- bash: SKIP_BIG_TESTS=1 PATH="`pwd`/ampl:$PATH" bash test.sh
displayName: Test package
# - job: windows
# pool: {vmImage: 'windows-2022'}
# variables: {AMPL_URL: '$(BUNDLES_URL)/$(MSWIN64_BUNDLE_NAME)'}
# steps:
# - task: DownloadBuildArtifacts@0
# inputs: {artifactName: 'drop', downloadPath: '.'}
# - bash: cp drop/release/* .
# displayName: Copy package
# # - bash: |
# # # Debug the following issue on azure pipelines:
# # # "C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -shared -static-libgcc -o rAMPL.dll tmp.def RcppExports.o rampl.o rcon_entity.o rcon_instance.o renvironment.o robj_entity.o robj_instance.o rparam_entity.o rset_entity.o rset_instance.o rvar_entity.o rvar_instance.o utils.o -L../inst/libs/i386 -L../inst/libs/x64 -lampl -LC:/PROGRA~1/R/R-40~1.3/bin/x64 -lR
# # # /usr/bin/sh: line 8: "C:/rtools40/mingw64/bin/"g++ -std=gnu++11 : No such file or directory
# # # no DLL was created
# # set -ex
# # grep " -shared " -R `R RHOME`
# # cat `R RHOME`/etc/x64/Makeconf
# # cat `R RHOME`/etc/i386/Makeconf
# # cat `R RHOME`/share/make/winshlib.mk
# # displayName: Debug azure-pipelines issue
# - bash: |
# set -ex
# cat `R RHOME`/share/make/winshlib.mk
# sed -i 's/\$(SHLIB_LD)/c:\/rtools40\/mingw64\/bin\/g++/g' `R RHOME`/share/make/winshlib.mk
# cat `R RHOME`/share/make/winshlib.mk
# displayName: Hack to fix azure-pipelines issue
# - bash: bash dependencies.sh
# displayName: Install Rcpp and testthat
# - bash: bash install.sh
# displayName: Install package
# - bash: bash download-ampl.sh $AMPL_URL
# displayName: Install AMPL
# - bash: SKIP_BIG_TESTS=1 PATH="`pwd`/ampl:$PATH" bash test.sh
# displayName: Test package