-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
155 lines (138 loc) · 4.7 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
sudo: true
language: python
git:
submodules: false
.ci-matrix-definitions:
- &linux-focal-nightly
os: linux
dist: focal
python: nightly
- &linux-focal-3-10-dev
os: linux
dist: focal
python: 3.10-dev
- &linux-focal-3-9
os: linux
dist: focal
python: 3.9
- &linux-focal-3-8
os: linux
dist: focal
python: 3.8
- &linux-focal-3-7
os: linux
dist: focal
python: 3.7
- &linux-focal-3-6
os: linux
dist: focal
python: 3.6 # = min required version for Emma
- &linux-reference # An alias to the main version we use for coverage, linting, ...
<<: *linux-focal-3-9
# Disabled since travis does not support python on windows
# - os: windows
install:
# TODO: Separate installs per stage (to speed-up the job) (MSc)
# General packages
- sudo apt-get install tree
- pip3 install -U pylint
- sudo apt-get install enchant # needed for pyenchant
- pip3 install -U pyenchant # needed for pylint spell checking
- pip3 install -U coverage
# Packages for Emma
- pip3 install -U Pygments Markdown matplotlib pandas "pypiscout>=2.0" graphviz svgwrite
# Packages for Emma reports + html doc
- sudo apt-get update
- sudo apt-get install graphviz
- pip3 install -U gprof2dot
# Install pip deployment packages
- pip3 install -U setuptools
- pip3 install -U wheel
- pip3 install -U twine
# Install mkdocs packages for GitHub pages deployment
- pip3 install -U "mkdocs>=1.1.2"
- pip3 install -U "mkdocs-material>=5.2.1"
# List installed pip packages
- pip3 list
.emma-testing-script:
- &emma-tests
- pushd tests
- python -m unittest -v
- popd
- &emma-deploy
- pushd tests
- pushd unit_tests
- python -m unittest -v
- popd
- popd # Get back to the Emma root folder to do a successful deployment
jobs:
include:
- stage: testing
<<: *linux-focal-nightly
script: *emma-tests
- stage: testing
<<: *linux-focal-3-10-dev
script: *emma-tests
- stage: testing
<<: *linux-focal-3-9
script: *emma-tests
- stage: testing
<<: *linux-focal-3-8
script: *emma-tests
- stage: testing
<<: *linux-focal-3-7
script: *emma-tests
- stage: testing
<<: *linux-focal-3-6
script: *emma-tests
- stage: linting
<<: *linux-reference
script:
- tree -a -I .git ./
- find . -type f -name "*.py" -exec pylint -j 0 --exit-zero {} \;
- stage: coverage
<<: *linux-reference
script:
- pushd ./tests/unit_tests
- coverage run --branch -m unittest -v
- coverage xml --omit="/home/travis/virtualenv/*","/home/travis/build/bmwcarit/Emma/tests/*" -o ./coverage.xml
- coverage report
- bash <(wget -q -O - https://coverage.codacy.com/get.sh) report -r ./coverage.xml
- tree -a -I .git ./
- popd
- stage: deployment
<<: *linux-reference
script: *emma-deploy
before_deploy:
- mkdocs build --verbose --clean # Build local version of the docs
deploy:
# Deploy mkdocs (GitHub pages)
- provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: site
# on:
# tags: true
# on:
# branch: 61-mkdocs-material-fix
# Deploy on PyPi database
- provider: pypi
# server: https://test.pypi.org/legacy/ # Activate for testing
user: ""
password:
secure: ""
distributions: "sdist bdist_wheel" # add `bdist_wheel` besides `sdist`
skip_existing: true
on:
tags: true
# branch: 18-pip-database # Activate for testing
# after_failure: tree -a -I .git ../
# Must be last point at this indentation level below include (see: https://travis-ci.community/t/why-allow-failures-didnt-work-for-this-build/5582/6 or https://github.com/svenfuchs/test-2/blob/dff1020f3a42159465967b9fa1b4d09f933c4da9/.travis.yml)
allow_failures:
- python: nightly
- python: 3.10-dev
- python: 3.9-dev
- python: 3.8-dev
- python: 3.7-dev
- python: 3.6-dev