-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
71 lines (63 loc) · 2.43 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
# Configure the build matrix
env:
matrix:
- TEST=validation # Validation tests: lint the XML, minify the Javascript, etc
- TEST=pgsql # Integration tests using PostgreSQL
- TEST=mysql # Integration tests using MySQL/MariaDB
global:
- secure: "nxosaZUBRaYhk8+LHaDnVgMIveiK4zewiXW5Fw5TtB/D6V67oASufil1uhcayyzIBwnrZZmrFPLhXm0Lm1RiQHrsftffcMB5JlWK9R9EyWpyd87ewqWy3kXBAvsXXTU6ihGiaFpklhVCKt7XcDSR8bWEb2NVWrM7JS7dHDKMwaA="
language: php
php:
- 7.1
- 7.2
dist: trusty
python:
- 3.3 # Required by Javascript linter/builder
git:
# Inhibit automatic submodule checkout (see below)
submodules: false
addons:
firefox: "45.9.0esr" # Required by Selenium tests
apt:
update: true
before_install:
# Check out submodules (this script checks out developer forks if necessary)
- ./tools/startSubmodulesTRAVIS.sh
- |
if [[ "$TEST" != "validation" ]]; then
# Prepare for unit and integration tests.
# Prepare the server environment
./lib/pkp/tools/travis/prepare-webserver.sh
source ./lib/pkp/tools/travis/start-xvfb.sh
./lib/pkp/tools/travis/start-selenium.sh
# Prepare the local codebase
./lib/pkp/tools/travis/install-composer-dependencies.sh
npm install && npm run build
else
# Prepare for validation tests.
./lib/pkp/tools/travis/install-linter.sh
fi
# The code coverage test is only performed in the MySQL test round.
- if [[ "$TEST" == "mysql" ]]; then ./lib/pkp/tools/travis/prepare-code-coverage.sh; fi
script:
- |
if [[ "$TEST" != "validation" ]]; then
# Run the unit and integration tests.
source ./lib/pkp/tools/travis/prepare-tests.sh
./lib/pkp/tools/travis/run-tests.sh
else
# Run the validation tests.
./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 -n 200 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)