-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
98 lines (88 loc) · 4.35 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
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"
# - "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: [email protected]:python-jsoner/jsoner.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:
# - coverage run tests.py
- pip install .
- python -c "import os; os.chdir('..'); import jsoner"
# ***tests***
# - coverage run tests.py
# - pytest --junitxml=reports/junit/junit.xml --html=reports/junit/report.html --cov-report term-missing --cov=./jsoner -v jsoner/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 jsoner # 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 docs/ # not in site/ anymore so that we do not need to use --dirty (it breaks client-side search)
# mkdocs gh-deploy requires special care :
# ---grant the possibility to push on the repo---
- openssl aes-256-cbc -K $encrypted_87e154705126_key -iv $encrypted_87e154705126_iv -in ci_tools/github_travis_rsa.enc -out ci_tools/github_travis_rsa -d
# If the output file does not exist, that is because the secret is invalid. This can happen in forked repos so do not fail the build
- |
if [ -s "ci_tools/github_travis_rsa" ]; then
chmod 600 ci_tools/github_travis_rsa
eval `ssh-agent -s` # launch the authentication agent
ssh-add ci_tools/github_travis_rsa # register the key
git config user.name "Automatic Publish"
git config user.email "[email protected]"
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: do not use the --dirty flag as it breaks client-side search
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; PYTHONPATH=jsoner/ mkdocs gh-deploy -v -f docs/mkdocs.yml --remote-name gh-remote; git push gh-remote gh-pages; fi;
else
echo "File 'ci_tools/github_travis_rsa' has not been created, please check your encrypted repo token in .travis.yml, on the line starting with 'openssl aes-256-cbc...'"
fi
deploy:
provider: pypi
user: "smarie"
password:
secure: "Gytf37KdoXuySlrzFXAW7qDNwRDLdvaSv395va0cS3lwNNPDxDNL6dM1dAPic7cvF88eY5gqfFlwUL2GyKwJFNKotMoZOawgNISM9iVcvNe5oF2jmgAstiArDO69Jr89zQQVCU1HIQxNnENeMe0e5iGCv9oU6y6+SzVCuRFoeNWY9qWORPPEKekwyRQcxgGXhLxdrfw48X/5HZGku+fZNjArnf/xQkfj1Esxz0HOHAMvDj25g+c/BTpGGZuqWO7lvRKVHoyiEH0mVrusTWl+pHoSmdX5RVzRqKWsNI/vQbVALCoDz/U0mtGdRohFitVdayli8gMH/Hqn/qzGDM6k1IpgwzL9shOQM3K64oL+vW6R4Er4hD7fTbZugQ1UpzlEIwLRA2DOPiQlHP/Gnf91atPOfg9Dhe7UUBCkWL7bQqLz56SvfyrHytvwSTBdFdTAFcVyd7IV6m18CgItOpf+WATb8VrCLfIHmIsiE92LR+RySvEVEVlwfREJWk0NHvr8vJVLm2pqBXvnUDGnar+8tAmQM5erPGiSsf4vxZBUW0FaM2LFxBs6XiWVIvc4PB0nkkj5WfGz7Vn73a0AGaPvvg/wk8xJ8wpXwID3qbJoc2rE/CPOgkkfBPUoPz2ihmoN6d+0R5UpaSI6ZAbJZm6c+ZpSVAa5PxUKYTCADtVRKGo="
on:
tags: true
python: 3.5 #only one of the builds have to be deployed
# server: https://test.pypi.org/legacy/
distributions: "sdist bdist_wheel"
matrix:
fast_finish: true
notifications:
email:
on_success: never # options: [always|never|change] default: always