forked from ChurchCRM/CRM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
79 lines (67 loc) · 2 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
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
php:
- 7.3
- 7.4
sudo: required
dist: xenial
group: edge
services:
- mysql
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/3f2dee1a025739ac5da7
on_success: change
on_failure: always
on_start: never
# optionally specify a list of environments, for example to test different RDBMS
env:
- DB=mysql
addons:
apt:
packages:
- apache2
- libapache2-mod-fastcgi
cache:
# Caches $HOME/.npm when npm ci is default script command
# Caches node_modules in all other cases
npm: true
directories:
# we also need to cache folder with Cypress binary
- ~/.cache
before_install:
- nvm install v14.15.0
- sudo gem install sass -v 3.4.25
- chmod +x ./travis-ci/*.sh
- chmod +x ./scripts/*.sh
- cp BuildConfig.json.example BuildConfig.json
# prepare travis ci for the build process
install:
- npm run deploy
# linters
before_script:
- ./travis-ci/setup-db.sh
- cp $TRAVIS_BUILD_DIR/travis-ci/Config.php $TRAVIS_BUILD_DIR/src/Include/Config.php
- cp $TRAVIS_BUILD_DIR/travis-ci/cypress.json $TRAVIS_BUILD_DIR/cypress.json
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo cp $TRAVIS_BUILD_DIR/travis-ci/www.conf ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
- sudo a2enmod rewrite proxy_fcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- sudo cp -f travis-ci/000-default.conf /etc/apache2/sites-available/000-default.conf
- sudo chmod -R a+rwx /home
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)/src?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart
# execute tests
script:
- npm test
before_deploy:
- npm run package
deploy:
skip_cleanup: true
provider: script
script: npm run demosite
on:
all_branches: true
php: 7.3
condition: "$TRAVIS_BRANCH == 'master' || $TRAVIS_BRANCH = 'develop'"