-
Notifications
You must be signed in to change notification settings - Fork 25
/
.travis.yml
128 lines (119 loc) · 4.91 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
# This is a special configuration file to run tests on Travis-CI via
# GitHub notifications when changes are committed.
#
# 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
language: python
cache: pip
jobs:
include:
- stage: lint
python: "3.6"
before_install:
- "if grep -P '\t' *.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; 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"
install:
- pip install --upgrade pip setuptools
- pip install black
- black --check --diff .
- pip install flake8 flake8-blind-except flake8-docstrings flake8-rst-docstrings restructuredtext-lint
- echo "Using flake8 to check Python code"
- flake8 .
- echo "Using restructuredtext-lint to check our RST files"
- restructuredtext-lint .
- pip install planemo
script:
- echo "Using planemo lint to check for obvious tool errors"
- planemo shed_lint --tools --fail_level error --ensure_metadata -r ${TRAVIS_BUILD_DIR}
- stage: test
python: "3.6"
env: GALAXY_BRANCH=master CHUNK=0
- stage: test
python: "3.6"
env: GALAXY_BRANCH=master CHUNK=1
- stage: test
python: "3.6"
env: GALAXY_BRANCH=dev CHUNK=0
- stage: test
python: "3.6"
env: GALAXY_BRANCH=dev CHUNK=1
- stage: deploy
before_install:
- echo "Removing tools we're not testing or deploying"
- for line in $(cat .tt_skip); do rm -rf $line; done
- for line in $(cat .deploy_skip); 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/ workflows/; 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.
#
#
# 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 want to test with specific branches of Galaxy, so we install it.
#
# Installing Tool Dependencies
# ============================
#
# Galaxy should resolve these via conda.
before_install:
- pip install --upgrade pip setuptools
- pip install planemo requests
- echo "Removing tools we're not going to test"
- for line in $(cat .tt_skip); do rm -rf $line; done
- 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}
- echo "Getting Galaxy to install our Python dependencies..."
- echo biopython >> requirements.txt
# Configuring tools within Galaxy
# ===============================
#
# We don't have any special datatypes, and planemo should take care
# of all the test files...
#
# Note https://github.com/galaxyproject/planemo/issues/530 workaround
install:
- cd ${TRAVIS_BUILD_DIR}/galaxy-${GALAXY_BRANCH}
# Explicitly use sample files to generate default *.loc files
- for f in ${TRAVIS_BUILD_DIR}/tool-data/*.loc.sample; do cp "$f" "${f%.sample}"; done
# Then explicitly override them with any non-sample *.loc files
- cp ${TRAVIS_BUILD_DIR}/tool-data/*.loc ${TRAVIS_BUILD_DIR}/galaxy-${GALAXY_BRANCH}/tool-data/
# Then explicitly override them with any test *.loc files
# - cp ${TRAVIS_BUILD_DIR}/test-data/*.loc ${TRAVIS_BUILD_DIR}/galaxy-${GALAXY_BRANCH}/tool-data/
# Testing tools in Galaxy
# =======================
#
# Having setup our Galaxy, and tools, now just call planemo test.
script:
- cd ${TRAVIS_BUILD_DIR}
- planemo --version
- planemo test --galaxy_root ${TRAVIS_BUILD_DIR}/galaxy-${GALAXY_BRANCH} --skip_venv `planemo ci_find_tools --chunk ${CHUNK} --chunk_count 2 tools/`
notifications:
email: false