-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (60 loc) · 2.04 KB
/
Copy pathtest.yml
File metadata and controls
65 lines (60 loc) · 2.04 KB
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
# This worklflow will perform unit test and check linting.
# - Test linting with flake8
# - Test the code with pytest.
#
# Maintainers:
# - name: Nisha Sharma
# - email: nisha.sharma@uni-jena.de
name: test
on:
workflow_call:
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nmr_predict
POSTGRES_SERVER: pgsql
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: 'Create env file'
run: |
touch .env
echo POSTGRES_USER="postgres" >> .env
echo POSTGRES_PASSWORD="password" >> .env
echo POSTGRES_SERVER="pgsql" >> .env
echo POSTGRES_PORT=5432 >> .env
echo POSTGRES_DB=nmr_predict >> .env
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install --upgrade setuptools pip
pip3 install --no-cache-dir -r requirements.txt
pip3 install rdkit
python3 -m pip uninstall -y imantics
pip3 install imantics==0.1.12
pip3 install openbabel-wheel
git clone "https://github.com/rinikerlab/lightweight-registration.git" lwreg
chmod +x lwreg
pip3 install --editable ./lwreg/.
pip install flake8 pytest
- name: Analysing the code with pylint
run: |
flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503 $(git ls-files 'app/*.py') .
- name: Run test
run: |
python3 -m pytest -p no:warnings --ignore=lwreg/lwreg/test-cli.py --ignore=lwreg/lwreg/test_lwreg.py --ignore=lwreg/lwreg/test_dbutils.py