-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
63 lines (53 loc) · 2.38 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
# Configure the build matrix
env:
matrix:
- TEST=validation
- TEST=pgsql
- TEST=mysql
global:
- secure: "nxosaZUBRaYhk8+LHaDnVgMIveiK4zewiXW5Fw5TtB/D6V67oASufil1uhcayyzIBwnrZZmrFPLhXm0Lm1RiQHrsftffcMB5JlWK9R9EyWpyd87ewqWy3kXBAvsXXTU6ihGiaFpklhVCKt7XcDSR8bWEb2NVWrM7JS7dHDKMwaA="
language: php
php:
- 7.1
- 7.2
dist: trusty
python:
- 3.3
git:
# We have to init submodules ourselves to make it recursive
submodules: false
addons:
firefox: "45.9.0esr"
apt:
update: true
before_install:
- ./tools/startSubmodulesTRAVIS.sh
- ./lib/pkp/tools/travis/install-composer-dependencies.sh
- npm install && npm run build
# Configure the webserver
- if [[ "$TEST" != "validation" ]]; then ./lib/pkp/tools/travis/prepare-webserver.sh; fi
# Start xvfb
- if [[ "$TEST" != "validation" ]]; then ./lib/pkp/tools/travis/start-xvfb.sh; fi
# Start Selenium
- if [[ "$TEST" != "validation" ]]; then ./lib/pkp/tools/travis/start-selenium.sh; fi
# Prepare code coverage
- if [[ "$TEST" == "mysql" ]]; then ./lib/pkp/tools/travis/prepare-code-coverage.sh; fi
# Install the JS linter
- if [[ "$TEST" == "validation" ]]; then ./lib/pkp/tools/travis/install-linter.sh; fi
# Sleep and output our logs, to avoid hanging build with no access to
# logs. This is useful for debugging but too verbose to leave enabled.
# - (sleep 590; cat access.log; cat error.log; cat xvfb-output; cat selenium-output; cat ./lib/pkp/tests/results/error.log) &
script:
- if [[ "$TEST" != "validation" ]]; then source ./lib/pkp/tools/travis/prepare-tests.sh; fi
- if [[ "$TEST" != "validation" ]]; then ./lib/pkp/tools/travis/run-tests.sh; fi
- if [[ "$TEST" == "validation" ]]; then ./lib/pkp/tools/travis/validate-xml.sh && ./lib/pkp/tools/buildjs.sh -n && ./lib/pkp/tools/checkHelp.sh; fi
after_script:
# Merge the coverage reports into one HTML report and upload to http://pkp.sfu.ca/test-coverage
- if [[ "$TEST" == "mysql" ]]; then ./lib/pkp/tools/travis/post-code-coverage.sh; fi
# Upload the completed database to the PKP server for other uses
- if [[ "$TEST" != "validation" ]]; then ./lib/pkp/tools/travis/post-data-build.sh; fi
# Print logs and outputs for debugging.
- tail -c 1048576 error.log
- cat ./lib/pkp/tests/results/error.log
- sudo apt-get install sharutils
- test "$(ls -A lib/pkp/tests/results | grep .png)" && (tar cz lib/pkp/tests/results/*.png | uuencode /dev/stdout)