Skip to content

Commit c9ad582

Browse files
committed
Add test workflow
1 parent d0c2aa8 commit c9ad582

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

.github/workflows/main.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: h5pyd CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [master]
7+
8+
env:
9+
ADMIN_PASSWORD: admin
10+
ADMIN_USERNAME: admin
11+
USER_NAME: test_user1
12+
USER_PASSWORD: test
13+
USER2_NAME: test_user2
14+
USER2_PASSWORD: test
15+
HSDS_USERNAME: test_user1
16+
HSDS_PASSWORD: test
17+
HSDS_PATH: /home/test_user1/
18+
HDF5_API_TEST_PATH_PREFIX: /home/test_user1/
19+
HSDS_ENDPOINT: http+unix://%2Ftmp%2Fhs%2Fsn_1.sock
20+
HDF5_VOL_CONNECTOR: REST
21+
ROOT_DIR: ${{github.workspace}}/hsdsdata
22+
BUCKET_NAME: hsdstest
23+
HS_ENDPOINT: http+unix://%2Ftmp%2Fhs%2Fsn_1.sock
24+
HS_USERNAME: test_user1
25+
HS_PASSWORD: test
26+
TEST2_USERNAME: test_user2
27+
TEST2_PASSWORD: test
28+
H5PYD_TEST_FOLDER: h5pyd_tests
29+
30+
jobs:
31+
build-and-test:
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
os: [ubuntu-latest,]
36+
python-version: ["3.10"] # ["3.8", "3.9", "3.10"]
37+
38+
runs-on: ${{ matrix.os }}
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v3
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Install dependencies
48+
shell: bash
49+
run: |
50+
python -m pip install --upgrade pip
51+
python -m pip install flake8 pytest
52+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
53+
54+
# - name: Lint with flake8
55+
# shell: bash
56+
# run: |
57+
# # stop the build if there are Python syntax errors or undefined names
58+
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
59+
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
60+
# flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
61+
62+
- name: Install package
63+
shell: bash
64+
run: |
65+
pip install -e .
66+
67+
- name: Checkout HSDS
68+
uses: actions/checkout@v3
69+
with:
70+
repository: HDFGroup/hsds
71+
path: ${{github.workspace}}/hsds
72+
73+
- name: Install HSDS dependencies
74+
shell: bash
75+
run: |
76+
python -m pip install --upgrade pip
77+
python -m pip install pytest
78+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
79+
80+
- name: Install HSDS
81+
shell: bash
82+
run: |
83+
cd ${{github.workspace}}/hsds
84+
pip install -e .
85+
86+
- name: Start HSDS
87+
shell: bash
88+
run: |
89+
cd ${{github.workspace}}/hsds
90+
mkdir data &&
91+
mkdir data/hsdstest &&
92+
cp admin/config/groups.default admin/config/groups.txt &&
93+
cp admin/config/passwd.default admin/config/passwd.txt &&
94+
hsds --root_dir data --host localhost --port 5101 --password_file admin/config/passwd.txt --logfile hs.log --loglevel DEBUG --config_dir=admin/config --count=4 &
95+
sleep 11 # let the nodes get ready
96+
97+
- name: Create h5pyd test folder
98+
shell: bash
99+
run: |
100+
hstouch -v /home/test_user1/h5pyd_tests
101+
102+
- name: Run h5pyd tests
103+
shell: bash
104+
run: |
105+
python testall.py

0 commit comments

Comments
 (0)