Skip to content

Commit 9a902f5

Browse files
committed
add github ci
1 parent dcbd112 commit 9a902f5

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Miniconda
20+
uses: conda-incubator/setup-miniconda@v3
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
activate-environment: test-env
24+
auto-activate-base: true
25+
26+
- name: Install conda dependencies
27+
shell: bash -l {0}
28+
run: |
29+
conda install -c bioconda python=${{ matrix.python-version }} cyvcf2 pytest
30+
31+
- name: Install package
32+
shell: bash -l {0}
33+
run: |
34+
pip install '.'
35+
36+
- name: Run tests
37+
shell: bash -l {0}
38+
run: |
39+
pytest
40+
python -m peddy -h
41+
pwd
42+
python -m peddy --plot data/ceph1463.peddy.vcf.gz data/ceph1463.ped
43+
44+
- name: Install htslib and test with chr-prefixed VCF
45+
shell: bash -l {0}
46+
run: |
47+
conda install -c bioconda htslib
48+
zcat data/ceph1463.peddy.vcf.gz | awk 'BEGIN{FS=OFS="\t"}{ if ($1 !~ /^#/){ $0="chr"$0 } print $0; }' | sed -e 's/contig=<ID=/contig=<ID=chr/' | bgzip -c > chr.vcf.gz
49+
tabix chr.vcf.gz
50+
python -m peddy chr.vcf.gz data/ceph1463.ped 2>e.log; tail e.log

0 commit comments

Comments
 (0)