Skip to content

Commit bb7f21d

Browse files
committed
CI test
1 parent c47521e commit bb7f21d

File tree

9 files changed

+164631
-35
lines changed

9 files changed

+164631
-35
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Python CI with PostgreSQL
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
services:
11+
postgres:
12+
image: postgres:13
13+
env:
14+
POSTGRES_USER: vmr
15+
POSTGRES_PASSWORD: vmr
16+
POSTGRES_DB: vmrdb
17+
ports:
18+
- 5433:5432
19+
options: >-
20+
--health-cmd="pg_isready -U gwajnberg -d vmrdb"
21+
--health-interval=10s
22+
--health-timeout=5s
23+
--health-retries=5
24+
env:
25+
DATABASE_URL: postgres://vmr:vmr@localhost:5433/vmrdb
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.11'
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -r requirements.txt
39+
40+
- name: Initialize DB schema
41+
run: |
42+
psql $DATABASE_URL -f db/schema/schema.sql
43+
44+
- name: Pre-fill dummy data
45+
run: |
46+
psql $DATABASE_URL -f db/schema/dummy_data.sql
47+
- name: Run parsin_excel
48+
run: |
49+
python parsing_excel_postgresql_v2.py --gene_mode T --mode wgs --auto --input tests/test_gene_mode.json
50+
- name: Run pytest suite
51+
run: |
52+
pytest -v

db/schema/dummy_data.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
INSERT INTO samples(sample_collector_sample_id) VALUES ('TEST001');
2+
INSERT INTO isolates(sample_id, isolate_id) VALUES (1, 'ISO001');
3+
INSERT INTO extractions(nucleic_acid_extraction_method) VALUES ('wgs');
4+
INSERT INTO sequencing(extraction_id) VALUES (1);
5+
INSERT INTO wgs_extractions(isolate_id,extraction_id) VALUES (1,1);
6+

0 commit comments

Comments
 (0)