-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
94 lines (84 loc) · 4.15 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
language: python
cache: pip
python:
# - "2.6"
# - "2.7"
# - "3.2"
# - "3.3"
# - "3.4"
- "3.5"
# - "3.5-dev" # 3.5 development branch
- "3.6"
# - "3.6-dev" # 3.6 development branch
# - "3.7-dev" # 3.7 development branch
# - "nightly" # currently points to 3.7-dev
# PyPy versions
# - "pypy" # PyPy2 2.5.0
# - "pypy3" # Pypy3 2.4.0
# - "pypy-5.3.1"
#
env:
global:
- GH_REF: git@github.com:smarie/python-parsyfiles.git
before_install:
- sudo apt-get install pandoc
- sudo apt-get install ant
- sudo apt-get install ant-optional
install:
- pip install -r ci_tools/requirements-setup.txt
- pip install -r ci_tools/requirements-test.txt
- pip install -r ci_tools/requirements-report.txt
- pip install -r ci_tools/requirements-doc.txt
- pip install codecov # https://github.com/codecov/example-python. This is specific to travis integration
# - pip install coveralls # this is an alternative to codecov
script:
- pip install .
- python -c "import os; os.chdir('..'); import parsyfiles"
# ***tests***
# - coverage run tests.py
# - pytest --junitxml=reports/junit/junit.xml --html=reports/junit/report.html --cov-report term-missing --cov=./parsyfiles -v parsyfiles/tests/
# now done in a dedicated script to capture exit code 1 and transform it to 0
- chmod a+x ./ci_tools/run_tests.sh
- sh ./ci_tools/run_tests.sh
after_success:
# ***reporting***
# - junit2html junit.xml testrun.html output is really not nice
- ant -f ci_tools/generate-junit-html.xml # generates the html for the test results. Actually we dont use it anymore
- python ci_tools/generate-junit-badge.py # generates the badge for the test results
- codecov
- pylint parsyfiles # note that at the moment the report is simply lost, we dont transform the result into anything
# ***documentation***
- mkdocs build -f docs/mkdocs.yml
- mv reports/junit site/
# move the sample files!
- mv parsyfiles/tests/demo site/
# mkdocs gh-deploy requires special care :
# ---grant the possibility to push on the repo---
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then exit 0; fi;
- openssl aes-256-cbc -K $encrypted_0d2deb3fc43b_key -iv $encrypted_0d2deb3fc43b_iv -in ci_tools/github_travis_rsa_pars.enc -out ci_tools/github_travis_rsa_pars -d
- chmod 600 ci_tools/github_travis_rsa_pars
- eval `ssh-agent -s` # launch the authentication agent
- ssh-add ci_tools/github_travis_rsa_pars # register the key
- git config user.name "Automatic Publish"
- git config user.email "sylvain.marie@schneider-electric.com"
- git remote add gh-remote "${GH_REF}";
- git fetch gh-remote && git fetch gh-remote gh-pages:gh-pages;
# push but only if this is not a build triggered by a pull request
# note: here we use the --dirty flag so that mkdocs does not clean the additional reports that we copied in the site
- if [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; PYTHONPATH=parsyfiles/ mkdocs gh-deploy -v --dirty -f docs/mkdocs.yml --remote-name gh-remote; git push gh-remote gh-pages; fi;
# - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; git push gh-remote gh-pages; fi;
deploy:
provider: pypi
user: "smarie"
password:
secure: "ixgMdgCcSxEAXMqeL/+1i5W3QxSDqS0a49qmru6Aw4wmjpJ7aMAxNPXw/CKHp6IB+GCwih+zmXotXXa81/WsUUNLSahbPr/2p6OeK73uzRBNo3ua+wIY6XKqfEdY12JzWKXi0QvvD3MhzXVt8dfZETdhJfSZ9LxXZx5bYObLT959wjQdgD/pA1y3qcY1QCW2JRS53mnCoJGvcz/T/GDn7go8bJxmKjhP6i90ntFCzczZ4ZC0b41Rgj0OwOO59/GYZRFh6Iwveekt8JTYOUqXMjk/OUJChyLAEOtJS/WM//tVV1MzoHasGEKUZcY6HGo5CP/uyW/y8o8P/GCAPhskxF+weXfxxGJZBsexbTJIdSKmzogQ3Myc8aJWErERRA9aDmsX1fYPrd96mpO3sBvHE2iQS4sEmUFXqi/TtUXc4lFQzHykXoxcVJBP+cyX7dCHBcow4IpJv5KkSkUFHZeM2DkTSGWMklVDOUriw/tg6Qlp4nIrKLv4fahSkaZFf9pMvyAA4YKJwGFZ2SSyWjmUezGV9DtXDgSPfq2a+PFAvAPC+PRrFuVBagMesBMM2pAIOV6JccIZWyl5fuof1VhO5p3nZk5uAoiAKDTDIixcvDCnOZZKH8BYYLmyNU35kiMIJsZdxMGFQrFIuuc6ZMezVDtnoxuXh7RwYVcLIKF2as8="
on:
tags: true
python: 3.6 #only one of the builds have to be deployed
# server: https://test.pypi.org/legacy/
distributions: "bdist_wheel"
matrix:
fast_finish: true
notifications:
email:
on_success: never # options: [always|never|change] default: always