-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
49 lines (42 loc) · 1.3 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
language: php
dist: trusty
sudo: false
php:
- 7.2
node_js:
- 10.9
cache:
directories:
- ~/.npm
- ~/.cache
- ~/.composer/cache
before_install:
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- phpenv config-rm xdebug.ini
- composer self-update
install:
- composer install
- cd tests && npm install && cd ..
- source .envrc
script:
- silverback setup
- if [[ -n "$SB_JIRA_PROJECTS" ]]; then silverback download-tests; fi
- drush serve > log.txt 2>&1 &
- until netstat -an 2>/dev/null | grep '8888.*LISTEN'; sleep 1; curl -I http://127.0.0.1:8888 ; do true; done
- if [[ -d web/modules/custom ]]; then phpunit web/modules/custom; fi
- |
cd tests
# The regex to get jira issue number from a git branch.
regex='(.*)(^|/)([A-Z]+[A-Z0-9]?-[0-9]+)(.*)'
# Get git branch.
branch="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
# Get the jira issue number from branch name and add it to cypress tags. Or
# run only completed tests.
[[ $branch =~ $regex ]] && \
export CYPRESS_TAGS="@${BASH_REMATCH[3]} or @COMPLETED" || \
export CYPRESS_TAGS="@COMPLETED"
echo "Going to run cypress with the following tags: $CYPRESS_TAGS"
cypress run
- kill $(jobs -p) || true
notifications:
email: false