forked from GMLC-TDC/helics-ns3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
113 lines (107 loc) · 3.47 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
107
108
109
110
111
112
113
jobs:
- job: Native
strategy:
matrix:
Linux:
imageName: "ubuntu-16.04"
macOS:
imageName: "macos-10.14"
pool:
vmImage: $(imageName)
steps:
# -----------------------
# Move the helics-ns3
# files into subfolder
# -----------------------
- script: |
shopt -s extglob dotglob
mkdir helics
mv !(helics) helics
shopt -u dotglob
displayName: 'Move helics-ns3 module files into subfolder'
# -----------------------
# Install dependencies
# -----------------------
# Linux
- bash: |
sudo apt-get update
sudo apt-get install -y libzmq5-dev ninja-build
echo "##vso[task.setvariable variable=BOOST_ROOT]${BOOST_ROOT_1_72_0}"
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Linux - Install ZeroMQ and Ninja
# macOS
- bash: |
brew install zeromq ninja boost
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: macOS - Install Boost, ZeroMQ, and Ninja
# -----------------------
# Checkout HELICS
# -----------------------
- bash: |
cmake --version
git clone --recursive https://github.com/GMLC-TDC/HELICS HELICS-dependency
cd HELICS-dependency
git checkout ${HELICS_COMMITISH:-develop}
if [[ "${HELICS_PR_TARGET}" != "" ]]; then
git config --global user.email "[email protected]"
git config --global user.name "HELICS-bot"
git merge --no-commit --no-ff origin/${HELICS_PR_TARGET} || exit $?
fi
git submodule update --init --recursive
displayName: Checkout HELICS
# -----------------------
# Configure HELICS
# -----------------------
# Linux, macOS
- task: CMake@1
inputs:
workingDirectory: HELICS-dependency/build
cmakeArgs: -GNinja -DCMAKE_BUILD_TYPE=Release -DHELICS_BUILD_CXX_SHARED_LIB=ON -DHELICS_DISABLE_C_SHARED_LIB=ON -DHELICS_BUILD_APP_LIBRARY=OFF -DHELICS_BUILD_TESTS=OFF -DHELICS_BUILD_EXAMPLES=OFF ..
displayName: 'Linux/macOS - Configure HELICS'
condition: ne( variables['Agent.OS'], 'Windows_NT' )
# -----------------------
# Install HELICS
# -----------------------
- bash: |
if [ -x "$(command -v sudo)" ]; then
sudo cmake --build . --target install
else
cmake --build . --target install
fi
displayName: 'Install HELICS'
workingDirectory: HELICS-dependency/build
# -----------------------
# Clone upstream ns-3
# -----------------------
- script: git clone https://gitlab.com/nsnam/ns-3-dev.git
displayName: 'Clone latest ns-3'
# -----------------------
# Configure ns-3
# -----------------------
- script: |
mv helics ns-3-dev/contrib
cd ns-3-dev
./waf configure --disable-werror --with-helics=/usr/local --enable-modules=helics --enable-examples --enable-tests | tee azure_waf_configure.log
! grep -Fq "HELICS not enabled" azure_waf_configure.log
displayName: 'Configure ns-3'
# -----------------------
# Build ns-3
# -----------------------
- script: |
cd ns-3-dev
./waf build
displayName: 'Build ns-3'
# -----------------------
# Report Upstream PR
# -----------------------
- job: Report_Results
displayName: Report Results
dependsOn: Native
condition: and(succeededOrFailed(), variables['HELICS_PR_TARGET'], variables['HELICS_PR_SLUG'], variables['HELICS_PR_NUM'])
variables:
PR_STATUS_REPORT: $[ dependencies.Native.result ]
steps:
- bash: |
.ci/report-results.sh
env:
HELICSBOT_GH_TOKEN: $(HELICSBot.GH.Token)