forked from sulu/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
85 lines (77 loc) · 2.63 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
sudo: false
language: php
services:
- mysql
cache:
directories:
- "$HOME/.composer/cache/files"
before_install:
- composer self-update
- phpenv config-add tests/travis.php.ini
env:
global:
- COMPOSER_VALIDATE_FLAGS="--strict"
matrix:
include:
# With ENVIRONMENT variables
- php: 7.2
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.4
install:
- composer create-project sulu/skeleton ../test-create-project-dir --repository="{\"type\":\"path\",\"url\":\"./\"}" --stability=dev -n
- cd ../test-create-project-dir
- echo 'DATABASE_URL=mysql://root:@127.0.0.1:3306/sulu' >> .env.local
- echo 'DATABASE_URL=mysql://root:@127.0.0.1:3306/sulu_test' >> .env.test.local
env:
- NPM_BUILD=true
- COMPOSER_VALIDATE_FLAGS="--strict --no-check-publish"
script:
- pwd
- |
if [[ $NPM_BUILD = true ]]; then
nvm install 12
cd assets/admin
npm install
npm run build
fi
- if [[ $NPM_BUILD = true ]]; then cd ../..; fi
- composer validate $COMPOSER_VALIDATE_FLAGS
# Test Build
- bin/adminconsole sulu:build dev --no-interaction
# Test container build in different environments
- bin/adminconsole cache:clear --env dev
- bin/websiteconsole cache:clear --env dev
- bin/adminconsole cache:clear --env test
- bin/websiteconsole cache:clear --env test
- bin/adminconsole cache:clear --env stage
- bin/websiteconsole cache:clear --env stage
- bin/adminconsole cache:clear --env prod
- bin/websiteconsole cache:clear --env prod
# Test container lint in different environments
- bin/adminconsole lint:container --env dev
- bin/websiteconsole lint:container --env dev
- bin/adminconsole lint:container --env test
- bin/websiteconsole lint:container --env test
- bin/adminconsole lint:container --env stage
- bin/websiteconsole lint:container --env stage
- bin/adminconsole lint:container --env prod
- bin/websiteconsole lint:container --env prod
# Lint
- bin/adminconsole doctrine:ensure-production-settings --env prod
- bin/adminconsole doctrine:schema:validate
- bin/phpunit
- bin/adminconsole lint:twig templates
- bin/adminconsole lint:yaml config