Skip to content

Commit f36423a

Browse files
committed
Add test workflow
1 parent d0c2aa8 commit f36423a

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

.github/workflows/main.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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+
HSDS_ENDPOINT: http+unix://%2Ftmp%2Fhs%2Fsn_1.sock
19+
HDF5_VOL_CONNECTOR: REST
20+
ROOT_DIR: ${{github.workspace}}/hsds/hsds_root
21+
BUCKET_NAME: hsds_bucket
22+
HS_ENDPOINT: http+unix://%2Ftmp%2Fhs%2Fsn_1.sock
23+
# HS_USERNAME: test_user1
24+
# HS_PASSWORD: test
25+
# TEST2_USERNAME: test_user2
26+
# TEST2_PASSWORD: test
27+
# H5PYD_TEST_FOLDER: h5pyd_tests
28+
29+
jobs:
30+
build-and-test:
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: [ubuntu-latest,]
35+
python-version: ["3.10"] # ["3.8", "3.9", "3.10"]
36+
37+
runs-on: ${{ matrix.os }}
38+
steps:
39+
- uses: actions/checkout@v3
40+
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v3
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
46+
- name: Install dependencies
47+
shell: bash
48+
run: |
49+
python -m pip install --upgrade pip
50+
python -m pip install flake8 pytest
51+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
52+
53+
# - name: Lint with flake8
54+
# shell: bash
55+
# run: |
56+
# # stop the build if there are Python syntax errors or undefined names
57+
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
58+
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
59+
# flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
60+
61+
- name: Install package
62+
shell: bash
63+
run: |
64+
pip install -e .
65+
66+
- name: Checkout HSDS
67+
uses: actions/checkout@v3
68+
with:
69+
repository: HDFGroup/hsds
70+
path: ${{github.workspace}}/hsds
71+
72+
- name: Install HSDS
73+
shell: bash
74+
run: |
75+
cd ${{github.workspace}}/hsds
76+
pip install -e .
77+
78+
- name: Start HSDS
79+
shell: bash
80+
run: |
81+
cd ${{github.workspace}}/hsds
82+
mkdir hsds_root
83+
mkdir hsds_root/hsds_bucket
84+
chmod -R 777 hsds_root
85+
cp admin/config/groups.default admin/config/groups.txt
86+
cp admin/config/passwd.default admin/config/passwd.txt
87+
./runall.sh --no-docker 1 &
88+
sleep 11 # let the nodes get ready
89+
python tests/integ/setup_test.py
90+
91+
#- name: Create h5pyd test folder
92+
# shell: bash
93+
# run: |
94+
# hstouch -v /home/test_user1/h5pyd_tests
95+
96+
- name: Run h5pyd tests
97+
shell: bash
98+
run: |
99+
HS_USERNAME=test_user1 HS_PASSWORD=test TEST2_USERNAME=test_user1 TEST2_PASSWORD=test python testall.py

0 commit comments

Comments
 (0)