Skip to content

Commit 0968ccf

Browse files
committed
Add test workflow
1 parent d0c2aa8 commit 0968ccf

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