forked from HDFGroup/vol-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
204 lines (180 loc) · 8.37 KB
/
main.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
195
196
197
198
199
200
201
202
203
204
name: Test REST VOL with socket
on:
workflow_dispatch:
push:
pull_request:
branches: [ master ]
paths-ignore:
- '.github/CODEOWNERS'
- 'docs/**'
- 'COPYING'
- '**.md'
jobs:
build_and_test_rest_vol:
strategy:
fail-fast: false
matrix:
#os: [ubuntu-latest, mac-latest]
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
test-path: ["/rest-vol/build/bin/test_rest_vol-shared"]
#test-path: ["/rest-vol/build/bin/test_rest_vol-shared", "/rest-vol/build/bin/h5vl_test"]
endpoint: ["http+unix://%2Ftmp%2Fhs%2Fsn_1.sock"]
runs-on: ${{matrix.os}}
steps:
- name: Create environment variable setup script
working-directory: ${{github.workspace}}
run: |
printf '%s\n' 'echo "ADMIN_PASSWORD=admin" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export ADMIN_PASSWORD=admin' >> setup_env_vars.sh
printf '%s\n' 'echo "ADMIN_USERNAME=admin" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export ADMIN_USERNAME=admin' >> setup_env_vars.sh
printf '%s\n' 'echo "USER_NAME=test_user1" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export USER_NAME=test_user1' >> setup_env_vars.sh
printf '%s\n' 'echo "USER_PASSWORD=test" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export USER_PASSWORD=test' >> setup_env_vars.sh
printf '%s\n' 'echo "USER2_NAME=test_user2" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export USER2_NAME=test_user2' >> setup_env_vars.sh
printf '%s\n' 'echo "USER2_PASSWORD=test" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export USER2_PASSWORD=test' >> setup_env_vars.sh
printf '%s\n' 'echo "HSDS_USERNAME=test_user1" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export HSDS_USERNAME=test_user1' >> setup_env_vars.sh
printf '%s\n' 'echo "HSDS_PASSWORD=test" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export HSDS_PASSWORD=test' >> setup_env_vars.sh
printf '%s\n' 'echo "HSDS_PATH=/home/test_user1/" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export HSDS_PATH=/home/test_user1/' >> setup_env_vars.sh
printf '%s\n' 'echo "HSDS_ENDPOINT=${{matrix.endpoint}}" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export HSDS_ENDPOINT=${{matrix.endpoint}}' >> setup_env_vars.sh
printf '%s\n' 'echo "HDF5_VOL_CONNECTOR=REST" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export HDF5_VOL_CONNECTOR=REST ' >> setup_env_vars.sh
printf '%s\n' 'echo "HDF5_PLUGIN_PATH=${{github.workspace}}/rest-vol/build/bin/" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export HDF5_PLUGIN_PATH=${{github.workspace}}/rest-vol/build/bin/' >> setup_env_vars.sh
printf '%s\n' 'echo "ROOT_DIR=${{github.workspace}}/hsdsdata" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export ROOT_DIR=${{github.workspace}}/hsdsdata' >> setup_env_vars.sh
printf '%s\n' 'echo "BUCKET_NAME=hsdstest" >> $GITHUB_ENV' >> setup_env_vars.sh
printf '%s\n' 'export BUCKET_NAME=hsdstest' >> setup_env_vars.sh
chmod 777 setup_env_vars.sh
- uses: actions/cache/restore@v3
with:
key: hsds
path: ${{github.workspace}}/hsds
id: hsds-restore
- uses: actions/checkout@v3
if: ${{!steps.hsds-restore.outputs.cache-hit}}
with:
repository: HDFGroup/hsds
path: ${{github.workspace}}/hsds
- uses: actions/cache/save@v3
if: ${{!steps.hsds-restore.outputs.cache-hit}}
with:
key: hsds
path: ${{github.workspace}}/hsds
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install package
shell: bash
run: |
cd ${{github.workspace}}/hsds
pip install -e .
- name: Run unit tests
shell: bash
run: |
cd ${{github.workspace}}/hsds
pytest
- name: Install Autotools Dependencies (Linux, serial)
run: |
sudo apt update
sudo apt install automake autoconf libtool libtool-bin
sudo apt install gcc-11 g++-11 gfortran-11
echo "CC=gcc-11" >> $GITHUB_ENV
echo "CXX=g++-11" >> $GITHUB_ENV
echo "FC=gfortran-11" >> $GITHUB_ENV
sudo apt install libaec0 libaec-dev
- name: Get REST VOL
uses: actions/checkout@v3
with:
path: ${{github.workspace}}/rest-vol
- uses: actions/cache/restore@v3
id: hdf5-restore
with:
key: hdf5
path: ${{github.workspace}}/hdf5install
- uses: actions/checkout@v3
if: ${{!steps.hdf5-restore.outputs.cache-hit}}
with:
repository: HDFGroup/hdf5
path: ${{github.workspace}}/hdf5
- name: Get REST-VOL dependencies
run: |
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libyajl-dev
- name: Autotools Configure HDF5
if: ${{!steps.hdf5-restore.outputs.cache-hit}}
run: |
sh ./autogen.sh
${{github.workspace}}/hdf5/configure --enable-shared --prefix=${{github.workspace}}/hdf5install
shell: bash
working-directory: ${{github.workspace}}/hdf5
- name: Autotools Build HDF5
if: ${{!steps.hdf5-restore.outputs.cache-hit}}
run: make
working-directory: ${{ github.workspace }}/hdf5
- name: Autotools Install
if: ${{!steps.hdf5-restore.outputs.cache-hit}}
run: make install
working-directory: ${{ github.workspace }}/hdf5
- if: ${{!steps.hdf5-restore.outputs.cache-hit}}
name: Cache hdf5 install
uses: actions/cache/save@v3
with:
key: hdf5
path: ${{github.workspace}}/hdf5install
- name: Clone vol-tests repo
uses: actions/checkout@v3
with:
path: ${{github.workspace}}/rest-vol/test/vol-tests/
repository: mattjala/vol-tests
- name: Prepare directory contents
run: |
cd ${{github.workspace}}/rest-vol
mkdir ${{github.workspace}}/rest-vol/build
cd ${{github.workspace}}/rest-vol/src/hdf5
cp -r ${{github.workspace}}/hdf5install/* .
- name: Start HSDS
if: ${{ matrix.endpoint != 'http://127.0.0.1:5101'}}
run: |
cd ${{github.workspace}}/hsds
mkdir ${{github.workspace}}/hsdsdata &&
mkdir ${{github.workspace}}/hsdsdata/hsdstest &&
cp admin/config/groups.default admin/config/groups.txt &&
cp admin/config/passwd.default admin/config/passwd.txt &&
cp admin/config/groups.default admin/config/groups.txt &&
cp admin/config/passwd.default admin/config/passwd.txt &&
${{github.workspace}}/setup_env_vars.sh
ROOT_DIR=${{github.workspace}}/hsdadata ./runall.sh --no-docker 1 &
sleep 10
working-directory: ${{github.workspace}}/hsds
- name: Test HSDS
if: ${{matrix.endpoint != 'http://127.0.0.1:5101'}}
run: |
${{github.workspace}}/setup_env_vars.sh
python tests/integ/setup_test.py
working-directory: ${{github.workspace}}/hsds
- name: Build REST VOL (Cmake)
run: |
cd ${{github.workspace}}/rest-vol/build
sudo CFLAGS="-D_POSIX_C_SOURCE=199506L" cmake -DPREBUILT_HDF5_DIR=${{github.workspace}}/hdf5install -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/rest-vol/build/install ..
sudo make -j
sudo make install
- name: Tests at ${{matrix.test-path}}
run: |
${{github.workspace}}/setup_env_vars.sh
${{github.workspace}}${{matrix.test-path}}