forked from LLNL/UnifyFS
-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (136 loc) · 4.58 KB
/
build-and-test.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
name: UnifyFS Build and Test
on:
pull_request:
branches: [ main, dev ]
push:
jobs:
checkpatch:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Checkpatch
run: |
eval $(git log HEAD^..HEAD | sed "s/^ *//g" | grep '^TEST_.*=')
export TEST_CHECKPATCH_SKIP_FILES
(git diff HEAD^..HEAD | ./scripts/checkpatch.sh origin/dev..HEAD) || test "$TEST_CHECKPATCH_ALLOW_FAILURE" = yes
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04 ]
compiler: [ gcc ]
gcc: [ 7, 8, 9, 10, 11 ]
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.gcc }}
runs-on: ${{ matrix.os }}
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
steps:
- name: Push checkout
if: github.event_name == 'push'
uses: actions/checkout@v3
- name: PR checkout
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.gcc }}
- name: Install additional packages
run: |
sudo apt-get update
sudo apt-get install libtool-bin
sudo apt-get install openmpi-bin
sudo apt-get install libopenmpi-dev
- name: Install Spack
uses: kzscisoft/install-spack@v1
with:
version: develop
- name: Set up packages.yaml
run: |
test -f $GITHUB_WORKSPACE/.spack/etc/spack/packages.yaml || cat > $GITHUB_WORKSPACE/.spack/etc/spack/packages.yaml << 'EOF'
packages:
all:
target: [x86_64]
providers:
mpi: [openmpi]
autoconf:
buildable: False
externals:
- spec: "autoconf@2.69"
prefix: /usr
automake:
buildable: False
externals:
- spec: "automake@1.16.1"
prefix: /usr
libtool:
buildable: False
externals:
- spec: "libtool@2.4.6"
prefix: /usr
m4:
buildable: False
externals:
- spec: "m4@1.4.18"
prefix: /usr
openmpi:
buildable: False
externals:
- spec: "openmpi@4.0.3"
prefix: /usr
openssl:
buildable: False
externals:
- spec: "openssl@1.1.1f"
prefix: /usr
pkg-config:
buildable: False
externals:
- spec: "pkg-config@0.29.1"
prefix: /usr
EOF
spack compiler find --scope=user
if [[ $CC == 'gcc-7' ]]; then
spack config add "packages:all:compiler:[gcc@7.5.0]"
elif [[ $CC == 'gcc-8' ]]; then
spack config add "packages:all:compiler:[gcc@8.4.0]"
elif [[ $CC == 'gcc-9' ]]; then
spack config add "packages:all:compiler:[gcc@9.3.0]"
elif [[ $CC == 'gcc-11' ]]; then
spack config add "packages:all:compiler:[gcc@11.1.0]"
else
spack config add "packages:all:compiler:[gcc@10.3.0]"
fi
spack external find
spack config add modules:prefix_inspections:lib64:[LD_LIBRARY_PATH]
spack config add modules:prefix_inspections:lib:[LD_LIBRARY_PATH]
- name: Install UnifyFS dependencies
run: |
spack install gotcha@1.0.4
spack install mochi-margo@0.13.1 ^mercury~boostsys ^libfabric@1.13.2 fabrics=rxm,sockets,tcp
spack install spath~mpi
echo "GOTCHA_INSTALL=$(spack location -i gotcha)" >> $GITHUB_ENV
echo "SPATH_INSTALL=$(spack location -i spath)" >> $GITHUB_ENV
- name: Configure and Build
run: |
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
source $GITHUB_WORKSPACE/.spack/share/spack/setup-env.sh
spack load gotcha && spack load argobots && spack load mercury && spack load mochi-margo && spack load spath
./autogen.sh
./configure CC=$CC --with-gotcha=$GOTCHA_INSTALL --with-spath=$SPATH_INSTALL --enable-fortran
make V=1
- name: Unit Tests
run: |
source $GITHUB_WORKSPACE/.spack/share/spack/setup-env.sh
spack load gotcha && spack load argobots && spack load mercury && spack load mochi-margo && spack load spath
cd t && make check
- name: After failure
if: ${{ failure() }}
run: |
cat $GITHUB_WORKSPACE/config.log
cat $GITHUB_WORKSPACE/t/test-suite.log