forked from wikimedia/pywikibot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
95 lines (81 loc) · 3.65 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
# See tests/README.rst for instructions for using travis with developer builds.
language: python
python:
- '2.7'
- '3.3'
- '2.6'
before_install:
- if [[ "$PYSETUP_TEST_EXTRAS" == "1" ]]; then sudo apt-get update -qq; fi
- if [[ "$PYSETUP_TEST_EXTRAS" == "1" ]]; then sudo apt-get install -y liblua5.1-dev; fi
install:
- if [[ "$SITE_ONLY" == '1' ]]; then export USE_NOSE=1; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2==0.8.0; fi
- pip install six
- export GITHUB_USER=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 1`
- mkdir ~/.pywikibot
- mkdir ~/.python-eggs
- chmod 700 ~/.python-eggs
- touch ~/.pywikibot/user-config.py
- echo "import os" >> ~/.pywikibot/user-config.py
- echo "mylang = '$LANGUAGE'" >> ~/.pywikibot/user-config.py
- echo "family = '$FAMILY'" >> ~/.pywikibot/user-config.py
- echo "password_file = os.path.expanduser('~/.pywikibot/passwordfile')" >> ~/.pywikibot/user-config.py
- touch ~/.pywikibot/passwordfile
- echo "max_retries = 2" >> ~/.pywikibot/user-config.py
- echo "maximum_GET_length = 5000" >> ~/.pywikibot/user-config.py
- echo "console_encoding = 'utf8'" >> ~/.pywikibot/user-config.py
- if [[ "$GITHUB_USER" == "wikimedia" ]]; then
PYWIKIBOT2_USERNAME="Pywikibot-test" ;
else
export PYWIKIBOT2_TEST_WRITE_FAIL=1 ;
fi
- if [[ -n "$USER_PASSWORD" && -n "$PYWIKIBOT2_USERNAME" ]]; then
echo "usernames['$FAMILY']['$LANGUAGE'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
echo "usernames['wikipedia']['en'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
echo "usernames['wikipedia']['test'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
echo "usernames['wikidata']['test'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
echo "usernames['commons']['commons'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
echo "('$PYWIKIBOT2_USERNAME', '$USER_PASSWORD')" > ~/.pywikibot/passwordfile ;
fi
- if [[ "$EXTERNALS_HTTPLIB2" == "1" ]]; then
(cd externals/httplib2 && python setup.py install) ;
else
rm -rf externals/httplib2 ;
fi
- python -c "import setuptools; print(setuptools.__version__)"
script:
- if [[ "$USE_NOSE" == "1" ]]; then
if [[ "$SITE_ONLY" == "1" ]]; then
echo "Running site tests only code ${LANGUAGE} on family ${FAMILY}" ;
python setup.py nosetests --tests tests --verbosity=2 -a "family=$FAMILY,code=$LANGUAGE" ;
else
python setup.py nosetests --tests tests --verbosity=2 ;
fi ;
else
python setup.py test ;
fi
env:
global:
# This is the encrypted password for Wikimedia SUL user 'Pywikibot-test',
# and is only decrypted by Travis when running builds of code merged into
# the github repository 'wikimedia/pywikibot-core'.
# See http://docs.travis-ci.com/user/encryption-keys/ for more information.
- secure: kofInMlisiTBt9o/Ustc/vySlkKfxGzGCX2LwA1D2waym8sDTS0o5gMJ5LsrT/BUKwZbe1vLozPHqZrrkQvsdTml+DpZuotzdILs0m0f3BUoexEC6OON5IDljuxFyETrD1Ug44ih5Mc4lVFOdTcBzg501ZmswGwQrBvg/OyEFfE=
matrix:
- LANGUAGE=en FAMILY=wikipedia EXTERNALS_HTTPLIB2=1
- LANGUAGE=ar FAMILY=wikipedia PYSETUP_TEST_EXTRAS=1
- LANGUAGE=test FAMILY=wikidata SITE_ONLY=1
- LANGUAGE=fr FAMILY=wiktionary SITE_ONLY=1 EXTERNALS_HTTPLIB2=1
notifications:
email:
recipients:
on_success: always
on_failure: always
irc:
channels:
- "chat.freenode.net#pywikibot"
on_success: change
on_failure: change
template:
- "%{repository_slug}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} %{build_url}"