-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
69 lines (63 loc) · 2.06 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
sudo: false
language: php
cache:
directories:
- "$HOME/.composer/cache/files"
before_install:
- composer self-update
- phpenv config-add tests/travis.php.ini
matrix:
include:
# With ENVIRONMENT variables
- php: 7.1
install:
# Install dependencies
- travis_retry composer update $COMPOSER_FLAGS
- composer info -i
# Create database for build test
- bin/adminconsole doctrine:database:create
env:
- APP_ENV=test
- APP_SECRET=a448d1dfcaa563fce56c2fd9981f662b
- MAILER_URL=null://localhost
- SULU_ADMIN_EMAIL=
- DATABASE_URL=mysql://root:@127.0.0.1/sulu_test
- COMPOSER_FLAGS="--no-interaction"
# Without ENVIRONMENT variables
- php: 7.2
env:
- COMPOSER_CREATE: true
- NPM_BUILD: true
script:
# Install project over composer create and set env variables in .env file
- |
if [[ $COMPOSER_CREATE = true ]]; then
composer create-project sulu/sulu-minimal ../test-create-project-dir --repository="{\"type\":\"path\",\"url\":\"./\"}" --stability=dev -n
cd ../test-create-project-dir
php -r "file_put_contents('.env', str_replace('DATABASE_URL=#mysql://db_user:[email protected]:3306/db_name', 'DATABASE_URL=mysql://root:@127.0.0.1:3306/sulu_test', file_get_contents('.env')));"
php -r "file_put_contents('.env', str_replace('APP_ENV=dev', 'APP_ENV=test', file_get_contents('.env')));"
fi
# Install NPM
- |
if [[ $NPM_BUILD = true ]]; then
nvm install 8
npm install -g npm
npm install
fi
# Test NPM build
- |
if [[ $NPM_BUILD = true ]]; then
npm run build
fi
# Validate composer
- composer validate --strict
# Test if installation works
- bin/adminconsole sulu:build dev --no-interaction
# Validate database schema
- bin/adminconsole doctrine:schema:validate
# Test if PHPUnit installation works
- vendor/bin/simple-phpunit
# Lint Twig files
- bin/adminconsole lint:twig templates
# Lint Yaml files
- bin/adminconsole lint:yaml config