-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
51 lines (43 loc) · 1.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
sudo: false
language: python
python:
- "2.7"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
addons:
apt:
packages:
- nodejs
- npm
before_script:
- pip install coverage
- export PYVER=`python -V 2>&1 | cut -d' ' -f2 | cut -d . -f 1,2`
- if [ "$PYVER" = "2.7" ]; then export NPM_FLG="T"; fi
- if [ "$NPM_FLG" = "T" ]; then
wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.0.3.778-linux.zip;
unzip sonar-scanner-cli-3.0.3.778-linux.zip;
export PATH=`pwd`/sonar-scanner-3.0.3.778-linux/bin:$PATH;
fi
script:
- python setup.py build install
- coverage run --source=./scripts setup.py test
- if [ "$NPM_FLG" = "T" ]; then
coverage report;
bash tests/build_example.sh;
cd tests;
npm i -g npm;
npm install;
npm test;
fi
after_success:
- if [ "$NPM_FLG" = "T" ]; then
cd ..;
sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.projectKey=paplot -Dsonar.sources=. -Dsonar.inclusions=paplot,scripts/*.py,scripts/paplot/*.py,scripts/paplot/subcode/*.py,tests/src/js/*.js,tests/src/html/*.js -Dsonar.python.coverage.reportPath=coverage.xml -Dsonar.javascript.lcov.reportPaths=tests/coverage/lcov.info -Dsonar.organization=${SONNAR_KEY} -Dsonar.login=${SONNAR_TOKEN};
fi
notifications:
emails:
on_success: change
on_failure: always