Skip to content

Commit 77b647c

Browse files
committed
Added Travis settings
1 parent 696642a commit 77b647c

12 files changed

Lines changed: 883 additions & 0 deletions

.travis.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
language: python
2+
3+
cache: pip
4+
5+
python:
6+
# - "2.6"
7+
# - "2.7"
8+
# - "3.2"
9+
# - "3.3"
10+
# - "3.4"
11+
- "3.5"
12+
# - "3.5-dev" # 3.5 development branch
13+
- "3.6"
14+
# - "3.6-dev" # 3.6 development branch
15+
# - "3.7"
16+
# - "3.7-dev" # 3.7 development branch
17+
# - "nightly" # currently points to 3.7-dev
18+
# PyPy versions
19+
# - "pypy" # PyPy2 2.5.0
20+
# - "pypy3" # Pypy3 2.4.0
21+
# - "pypy-5.3.1"
22+
#
23+
24+
env:
25+
global:
26+
- GH_REF: git@github.com:smarie/python-yamlable.git
27+
28+
before_install:
29+
- sudo apt-get install pandoc
30+
- sudo apt-get install ant
31+
- sudo apt-get install ant-optional
32+
33+
install:
34+
- pip install -r ci_tools/requirements-setup.txt
35+
- pip install -r ci_tools/requirements-test.txt
36+
- pip install -r ci_tools/requirements-report.txt
37+
- pip install -r ci_tools/requirements-doc.txt
38+
- pip install codecov # https://github.com/codecov/example-python. This is specific to travis integration
39+
# - pip install coveralls # this is an alternative to codecov
40+
41+
script:
42+
# - coverage run tests.py
43+
- pip install .
44+
- python -c "import os; os.chdir('..'); import yamlable"
45+
# ***tests***
46+
# - coverage run tests.py
47+
# - pytest --junitxml=reports/junit/junit.xml --html=reports/junit/report.html --cov-report term-missing --cov=./yamlable -v yamlable/tests/
48+
# now done in a dedicated script to capture exit code 1 and transform it to 0
49+
- chmod a+x ./ci_tools/run_tests.sh
50+
- sh ./ci_tools/run_tests.sh
51+
52+
after_success:
53+
# ***reporting***
54+
# - junit2html junit.xml testrun.html output is really not nice
55+
- ant -f ci_tools/generate-junit-html.xml # generates the html for the test results. Actually we dont use it anymore
56+
- python ci_tools/generate-junit-badge.py # generates the badge for the test results
57+
- codecov
58+
- pylint yamlable # note that at the moment the report is simply lost, we dont transform the result into anything
59+
# ***documentation***
60+
- mkdocs build -f docs/mkdocs.yml
61+
- mv reports/junit site/
62+
# mkdocs gh-deploy requires special care :
63+
# ---grant the possibility to push on the repo---
64+
- openssl aes-256-cbc -K $encrypted_a3be41b6f539_key -iv $encrypted_a3be41b6f539_iv -in ci_tools/github_travis_rsa.enc -out ci_tools/github_travis_rsa -d
65+
- chmod 600 ci_tools/github_travis_rsa
66+
- eval `ssh-agent -s` # launch the authentication agent
67+
- ssh-add ci_tools/github_travis_rsa # register the key
68+
- git config user.name "Automatic Publish"
69+
- git config user.email "sylvain.marie@schneider-electric.com"
70+
- git remote add gh-remote "${GH_REF}";
71+
- git fetch gh-remote && git fetch gh-remote gh-pages:gh-pages;
72+
# push but only if this is not a build triggered by a pull request
73+
# note: here we use the --dirty flag so that mkdocs does not clean the additional reports that we copied in the site
74+
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; PYTHONPATH=yamlable/ mkdocs gh-deploy -v --dirty -f docs/mkdocs.yml --remote-name gh-remote; git push gh-remote gh-pages; fi;
75+
# - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; git push gh-remote gh-pages; fi;
76+
77+
deploy:
78+
provider: pypi
79+
user: "smarie"
80+
password:
81+
secure: "TLBvYaFRplEFa8T0AW5b0LnRnz19/k/BEjtiiw4aWWrXTfNiWW1RRREG1iqqsqa6rkv547BVug2zj0SeeLvoncjGYclh92bmKMFhLVOlJtmYCIp8pNXT/3fEtrZosUN2OX4Z6qfOWnnefwjBB19rl18XPq/6zTyZ9dwKjkAfN+PPkHLqPtQ22+TcUe7f9jkDOs1pR0afacHz3HuBE5iaWbcDD2yCteJbfHwpFExfyO/X6LcjtQu63KH2NGvFP9qvwGrtnDIvmc1sWW9zi85H/j9T1TLQovJrY0oS8F+QOXbFlz/mOpORnh2sUj3f/nye0CvutnAqgS2OcRMqEAMIrdWzQOu8aBkKQuTOtiP+YKv7q7+GbWDIHJZK+whCWscS6XORVIaP5yGHc6SNZQqXarYskJFuRyJoClL51SxNsUzN4+yOLsdAqI/lvK2jIx4c2IztxuHEmbNwg1/R5/3YTk8g48U/nqOuIWBTNr0YwRRL/lBCxzGfHSjfcEnxzB0h/ORn0wBXig6tmNRyFAeA3qMHRekUgHjmzdZWw1yty3j1+sxdhOJXge+/AvqnNhSdY06w12WhEi4MV7p2pS5ZMX3Wnxvla/AzkCM4hrXxTYycAgFYjU2WkCCYqJwfV+Noa2hDbKPMHucoYBfB+qYNHUu0f+5uEGY3V5EhxZCmrGE="
82+
on:
83+
tags: true
84+
python: 3.5 #only one of the builds have to be deployed
85+
# server: https://test.pypi.org/legacy/
86+
distributions: "sdist bdist_wheel"
87+
88+
matrix:
89+
fast_finish: true
90+
91+
notifications:
92+
email:
93+
on_success: never # options: [always|never|change] default: always

ci_tools/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# private key
2+
github_travis_rsa*
3+
4+
# coverage results
5+
.coverage

0 commit comments

Comments
 (0)