forked from peterjc/galaxy_blast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
134 lines (123 loc) · 5.25 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
# This is a special configuration file to run tests on Travis-CI via
# GitHub notifications when changes are committed.
#
# This file is not intended for end users of the Galaxy BLAST+ tools.
#
# For technical details, see http://travis-ci.org/ and this blog post
# for background,
# http://blastedbio.blogspot.com/2013/09/using-travis-ci-for-testing-galaxy-tools.html
# We don't need sudo so can avoid slower legacy TravisCI infrastructure
sudo: false
# Galaxy currently only supports Python 2.7
language: python
cache: pip
jobs:
include:
- stage: test
python: "2.7"
env: GALAXY_BRANCH=master
- stage: test
python: "2.7"
env: GALAXY_BRANCH=dev
- stage: deploy
before_install:
- echo "Removing tools we're not testing"
- for line in $(cat .tt_blacklist); do rm -rf $line; done
install:
- pip install --upgrade pip setuptools
- pip install planemo
script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then planemo shed_update --shed_target testtoolshed --force_repository_creation --check_diff --shed_key_from_env TTS_KEY -r datatypes/ tools/ packages/ workflows/; true; fi
# Deployment
# ==========
# This is done with the new TravisCI stages feature, see
# https://blog.travis-ci.com/2017-05-11-introducing-build-stages
#
# Assumes you have set $TTS_KEY in the TravisCI interface,
# and that the test stage passed.
#
# As the deploy is run on a new VM, remove black-listed tools.
#
# Note use of "true" after the "planemo shed_update" which is
# a work-around for a Tool Shed administration rights issue, see
# https://github.com/galaxyproject/planemo/issues/543
#
#
# Planemo Lint
# ============
#
# Planemo can be run to check tools separately from Galaxy, and this
# is fast so we do it *before* the slow process of installing Galaxy
# and running the tool tests.
#
# Installing Galaxy
# =================
#
# We define extra datatypes, and therefore install a Galaxy instance
# and add the datatypes to it.
#
#
# Installing Tool Dependencies
# ============================
#
# We also need to install our tool dependencies, e.g. NCBI BLAST+ binaries,
# which we will do manually rather than via a (local) Galaxy Tool Shed.
before_install:
- "if grep -P '\t' *.rst */*.rst */*/*.rst; then echo 'Tabs are bad, please use four spaces in RST files.'; false; fi"
- "if grep -P '\t' */*/*.xml; then echo 'Tabs are bad, please use four spaces in XML files.'; false; fi"
- "if grep -P '\t' */*/.shed.yml; then echo 'Tabs are bad, please use four spaces in shed YAML files.'; false; fi"
- "if grep -n -r '[[:blank:]]$' *.rst */*.rst */*/*.rst; then echo 'Please remove trailing whitespace in RST files.'; false; fi"
- "if grep -n -r '[[:blank:]]$' */*/*.xml; then echo 'Please remove trailing whitespace in XML files.'; false; fi"
- "if grep -n -r '[[:blank:]]$' */*/.shed.yml; then echo 'Please remove trailing whitespace in shed YAML files.'; false; fi"
- pip install --upgrade pip setuptools
- pip install flake8 flake8-blind-except restructuredtext-lint
- echo "Using flake8 to check Python code"
- flake8 --max-line-length 120 .
- echo "Using restructuredtext-lint to check our RST files"
- restructuredtext-lint *.rst */*/*.rst
- pip install planemo
- echo "Using planemo lint to check for obvious tool errors"
- planemo shed_lint --tools --fail_level error --ensure_metadata --urls -r ${TRAVIS_BUILD_DIR}
- echo "Removing tools we're not going to test"
- for line in $(cat .tt_blacklist); do rm -rf $line; done
- echo "Fixing permissions on Python eggs cache folder"
- mkdir -p "$HOME/.python-eggs"
- chmod 700 "$HOME/.python-eggs"
- echo "Downloading and setting up dependencies..."
- export INSTALL_DIR=/tmp/dep_install && mkdir $INSTALL_DIR
- export DOWNLOAD_CACHE=/tmp/download_cache && mkdir $DOWNLOAD_CACHE
- planemo dependency_script ${TRAVIS_BUILD_DIR}/packages/package_blast_plus_2_5_0
- bash dep_install.sh
- source env.sh
- echo "Fetching Galaxy ${GALAXY_BRANCH} branch..."
- cd ${TRAVIS_BUILD_DIR}
- wget https://codeload.github.com/galaxyproject/galaxy/tar.gz/${GALAXY_BRANCH}
- tar -zxvf ${GALAXY_BRANCH} | tail
- cd galaxy-${GALAXY_BRANCH}
# Configuring tools within Galaxy
# ===============================
#
# We setup our datatypes by adding blast.py to the Galaxy library folder,
# and replacing the datatypes_conf.xml file.
#
# Note that as of October 2016, the Galaxy datatypes are back in the
# Galaxy core. Therefore we'll over-write them if needed.
install:
- cd ${TRAVIS_BUILD_DIR}/galaxy-${GALAXY_BRANCH}
- export GALAXY_TEST_UPLOAD_ASYNC=false
- export GALAXY_TEST_DB_TEMPLATE=https://github.com/jmchilton/galaxy-downloads/raw/master/db_gx_rev_0127.sqlite
- rm -f lib/galaxy/datatypes/blast.py
- ln -s ${TRAVIS_BUILD_DIR}/datatypes/blast_datatypes/blast.py lib/galaxy/datatypes/blast.py
- ln -s ${TRAVIS_BUILD_DIR}/.travis.datatypes_conf.xml datatypes_conf.xml
- bash scripts/common_startup.sh --no-create-venv --dev-wheels
# Testing tools in Galaxy
# =======================
#
# Having setup our Galaxy with our datatypes, and dependencies,
# call planemo test
script:
- cd ${TRAVIS_BUILD_DIR}
- planemo --version
- planemo test --no_conda_auto_install --galaxy_root ${TRAVIS_BUILD_DIR}/galaxy-${GALAXY_BRANCH} --skip_venv tools/
notifications:
email: false