This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
.travis.yml
108 lines (103 loc) · 5.16 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
language: python
dist: trusty
sudo: false
notifications:
slack:
rooms:
- secure: rWh65O2PuQdO9EEBfE2qb29j1d10WDI2kI/TOZL8r9yqHFWMApH/e4mbKJCmx47/TG3EJYg+oAPXqqmBwmUsMijzKtZ+DxUH+JHeqK5OFb5WqAuvmeUXykBDbLtOXMBwgUT3KAjjD9ZrpfsNVbzWF6qbQsk1AVAjuH8UDPbJEERDtg8LfWS7xx4dOgj1lMyW/Ws4p41E6zlpPqmem3jABAMdj0Jw226s/p2w69R1xVC5evPHJbqalsPbnkLQGbxl+TzKRbo/TrDFeKHDN2lL8k3+1UJeq+fl04jT8Rlai02MhOFR4qrFD2H1bKh2YdBXikao33gHb+tM+QHK6MPAVzX5G3z2ZNBs4j9Q8rS/pVmDAtDfL+LLwa522nt20pbuU4e9NWWvFye2GjNM9nOm4GfRksAGvoQinIeD7On/qrgbcSf7kQaOVFkP+Zk0WTRWptsTVg5w4o4IFv8O1aj1XzExUO1D9C7cyuRngqmngFkG6yFkCHycE5d+1MW1Y53+ECcJcN7A2MSer4y3crGdtF3ijiE4ZQDwJEGslDrVeCn+bjdsLxcenB3qKYB2d2sOHwvqLshpXvkCXQq+BWYQxjF+qg1KcQVYmI8tBUlHSlwZrs+AVnVDDFKeYOpbZPXLH62NZt/q2v+0aekSvcOwpB5xd8M+mR64tnawtssdQZ8=
on_success: change
on_failure: always
cache:
apt: true
directories:
- "$HOME/.cache/pip"
python:
- '2.7'
addons:
sauce_connect: true
apt:
sources:
- pov-wkhtmltopdf
packages:
- expect-dev
# TODO Investigate if this is needed. Stopped working in Travis so we
# added a pip install line for it, but may be used elsewhere in the stack.
- python-lxml
- python-simplejson
- python-serial
- python-yaml
- sshpass
- wkhtmltopdf
- chromium-browser
postgresql: '9.3'
env:
global:
- VERSION="8.0" RUN_PIPELINE="0" LINT_CHECK="0" TRANSIFEX="0" GRAPHJS="0" MOBJS="0" PYLINT_PR_CONFIG_FILE="travis_run_pylint.cfg"
matrix:
- LINT_CHECK="1" TESTS="0"
# Test nh_graph GraphLib JS
- GRAPHJS="1"
# Test nh_eob_mobile NHMobile JS
- MOBJS="1"
- ODOO_REPO="bjss/odoo" TESTS="1"
EXCLUDE="base,web,nh_odoo_fixes,nh_activity,nh_clinical,xml_test_output"
INCLUDE="nh_ews,nh_gcs,nh_graphs,nh_neurovascular,nh_observations,nh_pbp,nh_stools,nh_urinary_analysis,nh_vips,nh_eobs,nh_eobs_api,nh_eobs_backup,nh_eobs_default,nh_eobs_kiosk,nh_eobs_theme,nh_eobs_mobile,nh_eobs_mental_health,nh_neurological,nh_food_and_fluid,nh_weight,nh_blood_glucose"
VERSION="liveobs_1.11.1"
virtualenv:
system_site_packages: true
before_install:
- export CHROME_BIN=/usr/bin/chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
- export TZ=UTC
- git clone https://github.com/NeovaHealth/nhclinical.git NeovaHealth/nhclinical
- cd NeovaHealth/nhclinical
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
- export BRANCH_SOURCE=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
- if ! git rev-parse --verify "remotes/origin/$BRANCH_SOURCE"; then BRANCH="develop"; else BRANCH=$BRANCH_SOURCE; fi
- echo "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST, TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH_SOURCE=$BRANCH_SOURCE, BRANCH=$BRANCH"
- git checkout $BRANCH
- mkdir -p ${HOME}/dependencies
- for DIRECTORY in *; do mv ${DIRECTORY} ${HOME}/dependencies/${DIRECTORY}; done
- cd ../..
- git clone --depth=50 https://github.com/Gimpneek/odoo_xml_test_output.git odoo_xml_test_output
- cd odoo_xml_test_output
- pip install -r requirements.txt
# Install a pinned version of the dependencies so when OCA's requirements.txt is installed the dependency at this particular version is met
- pip install Python-Chart==1.39
- pip install astroid==1.3.8
- pip install Pillow==2.5.1
- pip install lxml==3.8.0
- mv xml_test_output ${HOME}/dependencies/xml_test_output
- cd ${TRAVIS_BUILD_DIR}
install:
- pip install --upgrade pip
- pip install -r requirements.txt
- git clone --depth=1 https://github.com/NeovaHealth/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- pip install -r ${HOME}/maintainer-quality-tools/requirements.txt
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- if [ "$GRAPHJS" == "0" ] && [ "$MOBJS" == "0" ] ; then travis_install_nightly ; fi
- if [ "$GRAPHJS" == "1" ] ; then cd nh_graphs/dev/coffee; npm install; fi
- if [ "$MOBJS" == "1" ] ; then cd nh_eobs_mobile/static/dev/coffee; npm cache clean; npm install; fi
before_script:
- npm install -g gulp-cli
script:
- if [ "$GRAPHJS" == "0" ] && [ "$MOBJS" == "0" ] ; then travis_run_tests ; fi
- if [ "$GRAPHJS" == "1" ] ; then gulp karma ; fi
- if [ "$MOBJS" == "1" ] ; then gulp travis ; fi
after_script:
- coverage xml -o ${HOME}/build/NeovaHealth/openeobs/coverage.xml
- cd ${HOME}/build/NeovaHealth/openeobs
- pip install codacy-coverage
- python-codacy-coverage -r coverage.xml
- echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><testsuites>" > test_report.xml
- for rep in ${HOME}/tests/*.xml; do cat "$rep" | grep -v "<?xml " >> test_report.xml;
done
- echo "</testsuites>" >> test_report.xml
- echo "Test result is ${TRAVIS_TEST_RESULT}"
- echo "Pipeline status is ${RUN_PIPELINE}"
- printf '{"branch":"%s","commit":"%s","pull_request":"%s","repository":{"name":"%s"}}' "$TRAVIS_BRANCH" "$TRAVIS_COMMIT" "$TRAVIS_PULL_REQUEST" "$TRAVIS_REPO_SLUG" > json.file
- pwd
- ls ./
- if [ "$TRAVIS_TEST_RESULT" == "0" -a "$RUN_PIPELINE" == "1" ]; then curl -v ${TARGET_URL}/$TARGET_JOB --user $TARGET_USER:$TARGET_PASSWORD -F json_file=@./json.file -F coverage_file=@./coverage.xml -F json='{"parameter":[{"name":"json_payload","file":"json_file"}, {"name":"coverage_report","file":"coverage_file"}]}'; fi