forked from ICTU/quality-report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
84 lines (84 loc) · 2.96 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
sudo: true
dist: xenial
language: python
python: 3.7
services:
- docker
before_install:
- nvm install node
install:
- pip install -r backend/requirements.txt
- pip install nose
- pip install codacy-coverage
- pip install codecov
jobs:
include:
- stage: test
python: 3.6
dist: trusty
sudo: false
script:
- cd backend
- python tests/run_qualitytests.py # Check code quality (pep8, pylint)
- stage: test
python: 3.7
dist: xenial
sudo: true
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- cd frontend
- npm install
- npm run build
- npm run cover
- cat coverage/lcov.info | ./node_modules/.bin/codacy-coverage
- cd ../backend
- coverage run --parallel-mode --branch --source=hqlib,tests tests/run_unittests.py
- coverage run --parallel-mode --branch --source=hqlib,tests tests/run_integrationtests.py
- coverage combine
- coverage xml
- python-codacy-coverage -r coverage.xml
- codecov
- nosetests --with-xunit tests/unittests/ # For SonarQube, see https://docs.sonarqube.org/display/PLUG/Python+Unit+Tests+Execution+Reports+Import
- cd ..
- sonar-scanner -Dsonar.login=$SONAR_TOKEN
- docker-compose -f testx.docker-compose.yml up --abort-on-container-exit
- docker-compose -f testx.docker-compose.yml down --volumes
after_script:
- cd backend
- ../cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
- cd ..
addons:
sonarcloud:
organization: ictu
- stage: deploy
if: tag IS present
python: 3.7
dist: xenial
sudo: true
script:
- cd backend
- python setup.py bundle sdist
- cd ..
- docker build --no-cache --build-arg hq_version=$HQ_VERSION -t ictu/quality-report:latest -t ictu/quality-report:$TRAVIS_TAG .
- cd backend
deploy:
- provider: pypi
skip_cleanup: true
on:
tags: true
user: fniessink
password:
secure: FI9Q2kC5D6i2hjK7t0GTVzYIgmU7H9GoI0qqtzVtT6V7gfV74HtfPxuIbkF6HND09GY1moSF5I0vyR8Bm2nMxEs+9PflYtNUMeNlyrEEof/brbYIrKujPGr6wVdgT4iZlMAVeybRTWhPQpo5PFsGuGcQa5cZOzt4fPPy/KO8C0c=
- provider: script
skip_cleanup: true
on:
tags: true
script: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker push ictu/quality-report
env:
global:
- HQ_VERSION=`echo $TRAVIS_TAG | python -c "import sys; sys.stdout.write(sys.stdin.read().lstrip('v'))"`
- CC_TEST_REPORTER_ID=58f7db7da1655acbe50dec6251772d4473dce782808e29b20299d5a7f3fca904
- secure: mOpbXELefnD2snAx7ie+wQwcF52/ee1n1ILeqjnSunDGHCZzitpYwVR1+hhqXyK0bNy+HdALCXf2rlqzJUvOsQmAYefj19w4K5SzejVd27MVeJ15EFX9NAruRo0Z3qg1jr5s0argFra5JrdXbfGGLWqY7Ejj5ZzG40VlRjKMx88=