This repository has been archived by the owner on Mar 17, 2023. It is now read-only.
/
.travis.yml
214 lines (202 loc) · 6.46 KB
/
.travis.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
os: linux
dist: trusty
language: python
notifications:
email:
if: branch = master
recipients:
- giesselmann@molgen.mpg.de
on_success: never
on_failure: always
python:
- "3.6"
cache:
directories:
- $HOME/docker
before_install:
# tag for docker from branch
- if [[ $TRAVIS_BRANCH == "master" ]]; then export DOCKER_TAG=latest;
else export DOCKER_TAG=$TRAVIS_BRANCH; fi
# Load cached docker images
# - if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
# before_cache:
# # Save tagged docker images
# - >
# mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}'
# | xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
jobs:
include:
# Base stage with python3 and shared libs
- &base
stage: base
env:
- MODULE=base_bionic
install: skip
script:
- export STAGE=base
- docker build -t $MODULE -f singularity/$MODULE/Dockerfile .
#- <<: *base
# env:
# - MODULE=base_alpine
# Build stage from base with gcc/g++ toolchain
- &build
stage: build
env:
- MODULE=build_bionic
install: skip
script:
- export STAGE=build
- docker build -t $MODULE -f singularity/$MODULE/Dockerfile --build-arg TAG=$DOCKER_TAG .
#- <<: *build
# env:
# - MODULE=build_alpine
# Modules from build stage, copied into base stage
- &modules
stage: module builds
env:
- MODULE=basecalling
install: skip
script:
- export STAGE=modules
- docker build -t $MODULE -f singularity/$MODULE/Dockerfile --build-arg TAG=$DOCKER_TAG .
- <<: *modules
env:
- MODULE=alignment
- <<: *modules
env:
- MODULE=methylation
- <<: *modules
env:
- MODULE=assembly
- <<: *modules
env:
- MODULE=demux
- <<: *modules
env:
- MODULE=sv
- <<: *modules
env:
- MODULE=transcript
# Unit tests per module
- &tests
stage: module tests
addons:
apt:
packages:
- build-essential
- libssl-dev
- uuid-dev
- libgpgme11-dev
- libseccomp-dev
- pkg-config
- squashfs-tools
env:
- SUITE=DNA
- MODULE=storage
install:
- pip install -r requirements.txt --upgrade
- rm -rf /home/travis/.gimme/versions/go1.*
- snakemake --snakefile rules/install.smk --directory $HOME singularity
- export PATH=$HOME/bin:$PATH
script:
- export STAGE=test
- python3 test/test_function.py $SUITE $MODULE $HOME/unit_tests --singularity
before_cache: skip
# DNA tests
- <<: *tests
env:
- SUITE=DNA
- MODULE=basecalling
- <<: *tests
env:
- SUITE=DNA
- MODULE=alignment
- <<: *tests
env:
- SUITE=DNA
- MODULE=methylation
- <<: *tests
env:
- SUITE=DNA
- MODULE=sv
- <<: *tests
env:
- SUITE=DNA
- MODULE=report
# cDNA tests
- <<: *tests
env:
- SUITE=cDNA
- MODULE=basecalling
- <<: *tests
env:
- SUITE=cDNA
- MODULE=alignment
- <<: *tests
env:
- SUITE=cDNA
- MODULE=transcript_isoforms
# mRNA tests
- <<: *tests
env:
- SUITE=mRNA
- MODULE=basecalling
- <<: *tests
env:
- SUITE=mRNA
- MODULE=alignment
- <<: *tests
env:
- SUITE=mRNA
- MODULE=transcript_isoforms
# Build all-in-one Docker from module container
- stage: nanopype build
env:
- MODULE=nanopype
install: skip
script:
- export STAGE=nanopype
- docker build -t $MODULE -f singularity/$MODULE/Dockerfile --build-arg TAG=$DOCKER_TAG .
# Test all-in-one Docker
- stage: nanopype test
before_cache: skip
script:
- export STAGE=test
- docker run --mount type=bind,source=$(pwd),target=/app nanopype/nanopype:$DOCKER_TAG python3 test/test_function.py DNA all /test
- docker run --mount type=bind,source=$(pwd),target=/app nanopype/nanopype:$DOCKER_TAG python3 test/test_function.py cDNA all /test
- docker run --mount type=bind,source=$(pwd),target=/app nanopype/nanopype:$DOCKER_TAG python3 test/test_function.py mRNA all /test
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
deploy:
- provider: script
cleanup: false
script: docker tag $MODULE $DOCKER_USERNAME/$MODULE &&
docker push $DOCKER_USERNAME/$MODULE &&
docker images
on:
tags: false
branch: master
repo: giesselmann/nanopype
condition: $STAGE =~ ^(base|build|modules|nanopype)$
- provider: script
cleanup: false
script: docker tag $MODULE $DOCKER_USERNAME/$MODULE:$TRAVIS_TAG &&
docker push $DOCKER_USERNAME/$MODULE:$TRAVIS_TAG &&
docker images
on:
tags: true
branch: master
repo: giesselmann/nanopype
condition: $STAGE =~ ^(base|build|modules|nanopype)$
- provider: script
cleanup: false
script: docker tag $MODULE $DOCKER_USERNAME/$MODULE:$TRAVIS_BRANCH &&
docker push $DOCKER_USERNAME/$MODULE:$TRAVIS_BRANCH &&
docker images
on:
tags: false
all_branches: true
repo: giesselmann/nanopype
condition: $TRAVIS_BRANCH != "master" && $STAGE =~ ^(base|build|modules|nanopype)$