-
Notifications
You must be signed in to change notification settings - Fork 3
194 lines (176 loc) · 6.3 KB
/
ci.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#
# ci.yml github actions continuous integration for pdlfs-common
# 22-May-2021 [email protected]
#
# workflow name. user defined string that displays on repo's action page.
name: CI
# workflow trigger. when to run? 'branches' limits scope to given branches.
on:
push:
branches:
- master
pull_request:
branches:
- master
# job(s) to run when workflow is triggered.
jobs:
# first (and only) job for this workflow: buildtest
buildtest:
# create a build matrix for this job. disable fail-fast so we
# do not fail the whole job if one branch of the matrix fails.
# you can use "include" to add branches to matrix and "exclude"
# to prune branches you do not want to build.
# XXX: putting lists in exclude doesn't work
# e.g. exclude:
# - compiler: [gcc-7, gcc-8]
strategy:
fail-fast: false
matrix:
build_type: [Debug, RelWithDebInfo]
compiler: [gcc-9, gcc-10, clang-10, clang-11]
os: [ubuntu-latest]
# can add include / exclude below to refine the matrix
# what os to run on (reference matrix above for this)
runs-on: ${{ matrix.os }}
# environment variables to provide to the job
env:
CI_BUILDTYPE: ${{ matrix.build_type }}
CI_COMPILER: ${{ matrix.compiler }}
# sequential set of steps (i.e. commands) for this job
steps:
#
# dump out our currently selected environment and add CI_COMPBASE,
# CI_CC, and CI_CXX to our environment using GITHUB_ENV.
#
- name: display selected environment config
run: |
echo "build=$CI_BUILDTYPE compiler=$CI_COMPILER"
cicc=$CI_COMPILER
cicompbase=`echo $cicc | sed -e 's/-.*//'`
if [ "$cicompbase" = "gcc" ]; then
cicxx=`echo $cicc | sed -e 's/^gcc/g++/'`
elif [ "$cicompbase" = "clang" ]; then
cicxx=`echo $cicc | sed -e 's/^clang/clang++/'`
else
echo "compbase error $cicompbase - unknown compiler basename"
fi
echo "CI_COMPBASE=$cicompbase" >> $GITHUB_ENV
echo "CI_CC=$cicc" >> $GITHUB_ENV
echo "CI_CXX=$cicxx" >> $GITHUB_ENV
#
# checkout our git tree
#
- name: github checkout source
uses: actions/checkout@v2
#
# set up environment using apt-get to install packages we need
# but don't build ourselves. we need an MPI installed to
# configure deltafs-umbrella, but we don't really use it here.
#
# note: clang includes C++, but g++ is its own package.
# XXX: run did not like /bin/sh case statement (syntax err, quoting?)
#
- name: setup selected environment
run: |
sudo apt-get update
sudo apt-get install -y $CI_COMPILER
if [ "$CI_COMPBASE" = "gcc" ]; then
sudo apt-get install -y $CI_CXX
fi
sudo apt-get install -y cmake automake
sudo apt-get install -y mpich libmpich-dev
sudo apt-get install -y libibverbs-dev libibverbs-dev
sudo apt-get install -y libpapi-dev libnuma-dev
sudo apt-get install -y librados-dev
#
# print out versions of some key programs (just for reference).
# also print out all CI_* env vars.
#
- name: version check
run: |
automake --version
cmake --version
git --version
printenv | egrep '^CI_'
#
# checkout an umbrella for packages we are going build (and cache)
# ourselves.
#
# XXX: we have to put umbrella in GITHUB_WORKSPACE because
# hashFiles() only works on files in that directory (I'd rather
# put it in /tmp). we make a gh-tmp directory for this.
#
- name: umbrella checkout
run: |
mkdir gh-tmp
cd gh-tmp && git clone https://github.com/pdlfs/deltafs-umbrella
#
# attempt to restore built umbrella packages from cache to save time.
# to force update, just change the suffix on the "key" below.
# we build umbrella packages with the default system provided compiler.
# for the key we use:
# - target OS
# - hash of umbrella CMakeLists.txt (e.g. to rebuild on change)
#
- name: umbrella cache restore
uses: actions/cache@v2
id: cache-umbrella
with:
path: /tmp/cache
key: ${{ runner.os }}-${{ hashFiles('gh-tmp/deltafs-umbrella/CMakeLists.txt') }}-c1
#
# on a cache miss, build the specified umbrella packages. we can
# use the bootstrap or the main umbrella to do it, as shown below.
#
- name: umbrella cache rebuild
if: steps.cache-umbrella.outputs.cache-hit != 'true'
run: |
echo rebuilding umbrella cache
cd gh-tmp/deltafs-umbrella
mkdir bootstrap/b
cd bootstrap/b
cmake -DCMAKE_INSTALL_PREFIX=/tmp/cache \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBOOTSTRAP="gflags;glog;snappy" -DSNAPPY_TAG=1.1.8 ..
make
cd ../..
mkdir b
cd b
cmake -DCMAKE_INSTALL_PREFIX=/tmp/cache \
-DMERCURY_NA_INITIALLY_ON="bmi;sm" \
-DMERCURY_SELF_FORWARD=ON \
-DMERCURY_CHECKSUM=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
..
make mercury
#
# after umbrella cache restore or build, list libs in umbrella
# cache just for reference.
#
- name: umbrella cache lib list
run: ls -C /tmp/cache/lib/*.so
#
# now we have everything we need, so we can configure our project
#
- name: configure project
run: |
mkdir b && cd b
export CC=$CI_CC CXX=$CI_CXX
cmake -DCMAKE_INSTALL_PREFIX=/tmp/pdlfs-common \
-DCMAKE_PREFIX_PATH=/tmp/cache \
-DCMAKE_BUILD_TYPE="$CI_BUILDTYPE" \
-DPDLFS_MERCURY_RPC=ON \
-DPDLFS_RADOS=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTS=ON ..
echo "cmake done"
#
# build project
#
- name: build project
run: date && cd b && make && date
#
# run tests
#
- name: run tests
run: date && cd b && ctest -VV --output-on-failure && date