Skip to content

Commit ba87916

Browse files
committed
Add test workflow
1 parent fdf1e40 commit ba87916

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/main.yml

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

0 commit comments

Comments
 (0)