forked from silverstripe/silverstripe-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
131 lines (113 loc) · 4.46 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
language: php
dist: trusty
before_install:
- sudo apt-get update
- sudo apt-get install chromium-chromedriver
cache:
directories:
- $HOME/.composer/cache/files
addons:
apt:
packages:
- tidy
firefox: "31.0"
env:
global:
- TRAVIS_NODE_VERSION="6"
- COMPOSER_ROOT_VERSION=1.4.x-dev
- DISPLAY=":99"
- XVFBARGS=":99 -ac -screen 0 1024x768x16"
- SS_BASE_URL="http://localhost:8080/"
- SS_ENVIRONMENT_TYPE="dev"
matrix:
fast_finish: true
include:
- php: 5.6
env: DB=PGSQL PHPUNIT_TEST=1
- php: 7.0
env: DB=MYSQL PHPUNIT_TEST=1 PHPCS_TEST=1
- php: 7.1
env: DB=MYSQL PHPUNIT_TEST=1
- php: 7.2
env: DB=MYSQL PHPUNIT_TEST=1 PDO=1
- php: 7.3
env: DB=MYSQL PHPUNIT_TEST=1
- php: 5.6
env:
- NPM_TEST=1
- RELEASE=1
- php: 7.0
env:
- DB=MYSQL
- BEHAT_TEST=admin
- php: 7.0
env:
- DB=MYSQL
- BEHAT_TEST=cms
before_script:
# Init PHP
- export CORE_RELEASE=$TRAVIS_BRANCH
- export PATH=/usr/lib/chromium-browser/:$PATH
- printf "\n" | pecl install imagick
- phpenv rehash
- phpenv config-rm xdebug.ini || true
- export PATH=~/.composer/vendor/bin:$PATH
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Install composer
- composer validate
- composer require silverstripe/recipe-testing:^1 silverstripe/recipe-core:4.4.x-dev silverstripe/versioned:1.4.x-dev --no-update
- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.1.x-dev --no-update; fi
- if [[ $DB == SQLITE ]]; then composer require silverstripe/sqlite3:2.0.x-dev --no-update; fi
- if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile; fi
- if [[ $BEHAT_TEST == cms ]]; then composer require silverstripe/recipe-cms:4.4.x-dev --no-update; fi
- composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
# Install NPM dependencies
- if [[ $NPM_TEST ]]; then nvm install $TRAVIS_NODE_VERSION && npm install -g yarn && yarn install --network-concurrency 1; fi
# Start behat services
- if [[ $BEHAT_TEST ]]; then mkdir artifacts; fi
- if [[ $BEHAT_TEST ]]; then cp composer.lock artifacts/; fi
- if [[ $BEHAT_TEST ]]; then sh -e /etc/init.d/xvfb start; sleep 3; fi
- if [[ $BEHAT_TEST ]]; then (chromedriver > artifacts/chromedriver.log 2>&1 &); fi
- if [[ $BEHAT_TEST == admin ]]; then (vendor/bin/serve --bootstrap-file vendor/silverstripe/framework/tests/behat/serve-bootstrap.php &> artifacts/serve.log &); fi
- if [[ $BEHAT_TEST == cms ]]; then (vendor/bin/serve --bootstrap-file vendor/silverstripe/cms/tests/behat/serve-bootstrap.php &> artifacts/serve.log &); fi
script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/php; fi
- if [[ $NPM_TEST ]]; then yarn run build; fi
- if [[ $NPM_TEST ]]; then git diff-files --quiet -w --relative=client; fi
- if [[ $NPM_TEST ]]; then git diff --name-status --relative=client; fi
- if [[ $PHPCS_TEST ]]; then composer run-script lint; fi
- if [[ $BEHAT_TEST == admin ]]; then vendor/bin/behat @admin; fi
- if [[ $BEHAT_TEST == cms ]]; then vendor/bin/behat @cms; fi
after_failure:
- php ./vendor/silverstripe/framework/tests/behat/travis-upload-artifacts.php --if-env BEHAT_TEST,ARTIFACTS_BUCKET,ARTIFACTS_KEY,ARTIFACTS_SECRET --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/ --artifacts-path ./artifacts/
before_deploy:
# Get asset-admin
- git clone https://github.com/silverstripe/silverstripe-asset-admin.git
- cd silverstripe-asset-admin
- yarn install
- cd ..
- mv silverstripe-asset-admin ../asset-admin
# Get campaign admin
- git clone https://github.com/silverstripe/silverstripe-campaign-admin.git
- cd silverstripe-campaign-admin
- yarn install
- cd ..
- mv silverstripe-campaign-admin ../campaign-admin
# Get CMS
- git clone https://github.com/silverstripe/silverstripe-cms.git
- cd silverstripe-cms
- yarn install
- cd ..
- mv silverstripe-cms ../cms
# Do the build
- yarn install && yarn build-storybook
deploy:
- provider: pages
skip_cleanup: true
keep-history: false
github-token: $GITHUB_AUTO_PUBLISH_API_TOKEN
local-dir: storybook-static
on:
branch: 1
repo: silverstripe/silverstripe-admin
condition: -n $RELEASE