forked from ec-europa/rdf_entity
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
74 lines (61 loc) · 2.68 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
language: php
php:
- 7.1
- 7.2
sudo: required
services:
- docker
mysql:
database: rdf_entity_test
username: root
encoding: utf8
env:
global:
- SITE_DIR="$HOME/build/testing_site"
matrix:
- TEST=PHP_CodeSniffer
- TEST=8.5.x
- TEST=8.6.x
matrix:
fast_finish: true
exclude:
- php: 7.2
env: TEST=PHP_CodeSniffer
# Todo: remove this section once we have a passing test suite on 8.6.x.
# Ref. https://github.com/ec-europa/rdf_entity/issues/58
allow_failures:
- env: TEST=8.6.x
before_install:
- composer --verbose self-update
- mkdir -p ${SITE_DIR}/web/modules
- cd ${SITE_DIR}
### PHP_CodeSniffer only.
# We only need the PHP Code Sniffer (and the Drupal coder).
- test ${TEST} == "PHP_CodeSniffer" && composer require drupal/coder || true
### PHPUnit only (till the end).
# Deploy the codebase.
- test ${TEST} == "PHP_CodeSniffer" || cp ${TRAVIS_BUILD_DIR}/tests/travis-ci/fixtures/composer.json.dist ${SITE_DIR}/composer.json
- test ${TEST} == "PHP_CodeSniffer" || cp ${TRAVIS_BUILD_DIR}/tests/travis-ci/fixtures/phpunit.xml.dist ${SITE_DIR}/web/phpunit.xml
- test ${TEST} == "PHP_CodeSniffer" || sed -i -e 's#\$TRAVIS_BUILD_DIR#'${TRAVIS_BUILD_DIR}'#g' composer.json
- test ${TEST} == "PHP_CodeSniffer" || composer require drupal/core:$TEST --no-interaction
# Virtuoso setup.
- test ${TEST} == "PHP_CodeSniffer" || mkdir ${SITE_DIR}/virtuoso
- test ${TEST} == "PHP_CodeSniffer" || docker run --name virtuoso -p 8890:8890 -p 1111:1111 -e SPARQL_UPDATE=true -v ${SITE_DIR}/virtuoso:/data -d tenforce/virtuoso
# Create the MySQL database.
- test ${TEST} == "PHP_CodeSniffer" || mysql -e 'CREATE DATABASE rdf_entity_test'
# Install Drupal.
- test ${TEST} == "PHP_CodeSniffer" || ./vendor/bin/drush site:install testing --yes --root=${SITE_DIR}/web --db-url=mysql://root:@127.0.0.1/rdf_entity_test
# Add the SPARQL connection to settings.php.
- test ${TEST} == "PHP_CodeSniffer" || chmod 0775 ${SITE_DIR}/web/sites/default/settings.php
- test ${TEST} == "PHP_CodeSniffer" || cat ${TRAVIS_BUILD_DIR}/tests/travis-ci/fixtures/connection.txt >> ${SITE_DIR}/web/sites/default/settings.php
# Enable the 'rdf_entity' module.
- test ${TEST} == "PHP_CodeSniffer" || ./vendor/bin/drush pm:enable rdf_entity --yes --root=${SITE_DIR}/web
# Start the webserver for browser tests.
- cd ${SITE_DIR}/web
- test ${TEST} == "PHP_CodeSniffer" || nohup php -S localhost:8888 > /dev/null 2>&1 &
# Wait until the web server is responding.
- test ${TEST} == "PHP_CodeSniffer" || until curl -s localhost:8888; do true; done > /dev/null
- cd ..
script: ${TRAVIS_BUILD_DIR}/tests/travis-ci/scripts/run_tests ${TEST}
notifications:
email: false