-
Notifications
You must be signed in to change notification settings - Fork 10
117 lines (107 loc) · 4.15 KB
/
Copy pathci.yml
File metadata and controls
117 lines (107 loc) · 4.15 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: CI
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
workflow_dispatch:
jobs:
build-test:
runs-on: ubuntu-latest
env:
NIM_VERSION: 1.6.10
HTSLIB_VERSION: 1.22.1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache nimble packages
uses: actions/cache@v4
with:
path: ~/.nimble
key: nimble-${{ runner.os }}-${{ hashFiles('strling.nimble') }}
restore-keys: |
nimble-${{ runner.os }}-
- name: Setup Nim
run: |
export CHOOSENIM_CHOOSE_VERSION=$NIM_VERSION
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
sh init.sh -y
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
export PATH=/home/runner/.nimble/bin:$PATH
- name: Install system build deps
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake libcurl4-openssl-dev libssl-dev zlib1g-dev libbz2-dev liblzma-dev wget unzip
- name: Build htslib
run: |
wget https://github.com/samtools/htslib/releases/download/${HTSLIB_VERSION}/htslib-${HTSLIB_VERSION}.tar.bz2
tar xjf htslib-${HTSLIB_VERSION}.tar.bz2
cd htslib-${HTSLIB_VERSION}
autoheader && autoconf && ./configure --enable-libcurl
make -j 2
echo "LD_LIBRARY_PATH=$PWD" >> $GITHUB_ENV
- name: Nimble install
run: nimble install -y
- name: Build strling help
run: ./strling -h
- name: Unit tests
run: nimble test -y
integration-e2e:
# Only run end-to-end tests on pushes to master to keep PRs fast
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build-test
env:
HTSLIB_VERSION: 1.10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nim
run: |
export CHOOSENIM_CHOOSE_VERSION=$NIM_VERSION
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
sh init.sh -y
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
export PATH=/home/runner/.nimble/bin:$PATH
- name: Install system build deps
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake libcurl4-openssl-dev libssl-dev zlib1g-dev libbz2-dev liblzma-dev wget unzip
- name: Build htslib
run: |
wget https://github.com/samtools/htslib/releases/download/${HTSLIB_VERSION}/htslib-${HTSLIB_VERSION}.tar.bz2
tar xjf htslib-${HTSLIB_VERSION}.tar.bz2
cd htslib-${HTSLIB_VERSION}
autoheader && autoconf && ./configure --enable-libcurl
make -j 2
echo "LD_LIBRARY_PATH=$PWD" >> $GITHUB_ENV
- name: Nimble install
run: nimble install -y
- name: Download test data
run: |
mkdir -p run_tests
cd run_tests
wget -O data.zip https://ndownloader.figshare.com/articles/11367851?private_link=207b2a78ddcbdb28781b
unzip data.zip
rm data.zip
wget -O chr4.fa.gz https://hgdownload.soe.ucsc.edu/goldenPath/hg38/chromosomes/chr4.fa.gz
gzip -d chr4.fa.gz
- name: End-to-end single sample
run: |
cd run_tests
mkdir -p single
../strling extract -f chr4.fa -g chr4.fa.str -v CANVAS.chr4-39348425_AAGGG_0_400.bam single/CANVAS.chr4-39348425_AAGGG_0_400.str.bin
../strling call -v -o single/CANVAS.chr4-39348425_AAGGG_0_400 CANVAS.chr4-39348425_AAGGG_0_400.bam single/CANVAS.chr4-39348425_AAGGG_0_400.str.bin
- name: End-to-end joint samples
run: |
cd run_tests
mkdir -p joint
for i in *.bam; do ../strling extract -f chr4.fa -g chr4.fa.str -v $i joint/$i.str.bin; done
../strling merge -f chr4.fa -v -o joint/strling joint/*.bin
for i in *.bam; do ../strling call -v -b joint/strling-bounds.txt -o joint/$i $i joint/$i.str.bin; done
- name: Inspect outputs
run: |
cd run_tests
head single/*.txt || true
head joint/strling-bounds.txt || true
head joint/*.txt || true