This repository has been archived by the owner on Jul 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
172 lines (162 loc) · 5.16 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
###############################################################################
# Ascent CI Checks
###############################################################################
# Ref:
# https://aka.ms/yaml
#####
# TO USE A NEW CONTAINER, UPDATE TAG NAME HERE AS PART OF YOUR PR!
#####
variables:
main_tag : alpinedav/ascent-ci:ubuntu-18-devel
# only build merge target pr to develop
trigger: none
pr:
branches:
include:
- master
# fast fail sanity checks
stages:
# main checks
- stage: Main
jobs:
###############################################################################
# Ubuntu build and test, using spack to build tpls
###############################################################################
- job: Main_Ubuntu_18
pool:
vmImage: 'ubuntu-latest'
container: ${{ variables.main_tag }}
timeoutInMinutes: 0
variables:
COMPILER_CC: gcc
COMPILER_CXX: g++
COMPILER_FC: gfortran
strategy:
matrix:
shared_debug:
BUILD_SHARED_LIBS: ON
ENABLE_OPENMP : ON
CMAKE_BUILD_TYPE: Debug
shared_release:
BUILD_SHARED_LIBS: ON
CMAKE_BUILD_TYPE: Release
ENABLE_OPENMP : ON
static_debug:
BUILD_SHARED_LIBS: OFF
ENABLE_OPENMP : ON
CMAKE_BUILD_TYPE: Debug
static_release:
BUILD_SHARED_LIBS: OFF
CMAKE_BUILD_TYPE: Release
ENABLE_OPENMP : ON
steps:
- checkout: self
clean: boolean
submodules: recursive
- script: |
##################
# setup build env
##################
# output env
cat etc/*rel*
env
# clean default paths
sudo rm -rf /usr/local/lib/android/
sudo rm -rf /usr/share/miniconda/
# add extra repo and update
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
# list pkgs we need
export APT_PKGS=binutils
export APT_PKGS="$APT_PKGS gcc"
export APT_PKGS="$APT_PKGS g++"
export APT_PKGS="$APT_PKGS openmpi-bin"
export APT_PKGS="$APT_PKGS libopenmpi-dev"
export APT_PKGS="$APT_PKGS libncurses-dev"
export APT_PKGS="$APT_PKGS libssl-dev"
export APT_PKGS="$APT_PKGS zlib1g-dev"
export APT_PKGS="$APT_PKGS libgdbm-dev"
export APT_PKGS="$APT_PKGS libreadline-dev"
export APT_PKGS="$APT_PKGS libsqlite3-dev"
export APT_PKGS="$APT_PKGS libbz2-dev"
export APT_PKGS="$APT_PKGS cmake"
# install pkgs we need
sudo apt-get -y install $APT_PKGS
displayName: 'Prepare build env'
- script: |
#################################
# configure
#################################
# setup compiler env vars
export CC=${COMPILER_CC}
export CXX=${COMPILER_CXX}
${CC} --version
# capture current path
export ROOT_DIR=`pwd`
echo $PATH
which cmake
cmake --version
# prepare build and install dir
mkdir install
mkdir build
cd build
# setup cmake options
export CMAKE_OPTS="-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
export CMAKE_OPTS="${CMAKE_OPTS} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}"
export CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_INSTALL_PREFIX=../install"
# configure
cmake ${CMAKE_OPTS} ../src
displayName: 'Configure with CMake'
- script: |
#################################
# build
#################################
# build
cd build
make VERBOSE=1
displayName: 'Build'
- script: |
#################################
# test
#################################
# find spack installed cmake
export ROOT_DIR=`pwd`
which ctest
cd build
# run ctest
ctest -T test --output-on-failure -V
displayName: 'Run Unit Tests'
- script: |
#################################
# install
#################################
cd build
make install
displayName: 'Install'
- script: |
###########################
# using with cmake example
###########################
pwd
ls -l
which cmake
cd install/examples/apcomp/using-with-cmake
mkdir _test_build
cd _test_build
cmake ../
make VERBOSE=1
./apcomp_example
displayName: 'Test vs Install (using-with-cmake)'
condition: succeeded()
- script: |
###########################
# using with make example
###########################
cat install/share/apcomp/apcomp_config.mk
pwd
ls -l
cd install/examples/apcomp/using-with-make
make
./apcomp_example
displayName: 'Test vs Install (using-with-make)'
condition: succeeded()