This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.travis.yml
104 lines (88 loc) · 3.16 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
# TalentCloud CI build
# .travis.yml
os: linux
dist: trusty
language: php
php:
- '7.2'
services:
- docker
# beta opt-in (build config validation)
version: ~> 1.0
branches:
only:
- dev
- master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/ # Tagged releases, i.e. v1.0.4
jobs: # run test suites simultaneously
include:
- env: TEST_SUITE=jest
- env: TEST_SUITE=phpunit
- env: TEST_SUITE=browser
env: # allow parallel makefile tasks
global:
- MAKEFLAGS="-j 2"
addons: # for browser tests
chrome: stable
hosts:
- talent.test
cache:
directories:
- $HOME/.composer/cache/files
# npm cached by default
before_install:
- phpenv config-rm xdebug.ini # remove xdebug
- sudo service postgresql stop # free port 5432
- travis_retry composer self-update # latest version of composer
- travis_retry nvm install --lts # update container node version
install:
- cp .env.travis .env # environment variables
- travis_retry composer install --no-interaction --prefer-dist --no-suggest
- travis_retry npm install # install dependencies
- travis_retry make docker-start # initialize containers
- travis_retry make gen-certs # ssl certificates
- travis_retry make create-symlink # create symlink
- travis_retry make build-db # database / data
- travis_retry make set-perms # file permissions
- travis_retry npm run dev # compiled assets
before_script:
# start headless chrome, web server
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
- php artisan serve &
# browser test setup
- if [ $TEST_SUITE = "browser" ]; then
export DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
script:
# check dependencies for security vulnerabilities
# npm run snyk
# code coverage setup
- if [ $TEST_SUITE != "browser" ]; then
mkdir -p report/;
ci_env=`bash <(curl -s https://codecov.io/env)`;
docker run $ci_env gctcntgc/talentcloud sh;
fi
# run phpunit and jest as separate jobs
- if [ $TEST_SUITE = "jest" ]; then
npm run test;
fi
# test fails will cause the job to fail (after separating)
- if [ $TEST_SUITE = "phpunit" ]; then
make phpunit;
fi
# run browser tests
- if [ $TEST_SUITE = "browser" ]; then
npm run testcafe-ci;
fi
after_script:
# upload coverage reports, tear down
- bash <(curl -s https://codecov.io/bash)
- travis_retry make docker-stop
notifications:
# only slack notifications
email:
- never
slack:
secure: EBouzYqOO3XWXMwHwV7KC3ihzsmnCrGCdIFdIRx4Dq1+/7/KVITUuj1WPCTGNbq87CrHOhBp0PVlLp8JdGZlLq6LVzUiqcEFACJwLAtU+G2N1JR6OQ8Ujr1QyGTReeVhKgey0UIM9cQc0AzqEIALERwsPy+OQ8oxn/G5+n8WbHe3cUTsudZVI7EZAFvyaivmV2KLBs94ss0c13CxKlOF4AQ+2QOsw1atFKRMzuiMmFosWKNoccVSJhwM0+yyU1iLZ8nLLJLre5+YRQBOnersAyogRVN5E0YgPBIGIa/+ArP3x8JSQOLppC3g3yOLMkoGnxJ4CypmmxHdFbDEVqp1ngZHnZg6H+p1jadCPNlsGtdudUFre+iPcXWvoWgiXO5FO2SKnzFYDkV5GiKfVe+aEAgJGrnMnwDfqpCEVDZ24Sgih/xUCRZblR5Fb3RPI1om6hkP3yWx3/0Q6THLlIcDt0BwL0YpNqd9sMPvK+uj76OmoWv/sD8Bb4EqdoCd9wWBCsjzbwuqO1USXRKNDvQXF+ahTq8VCEVyw/6NUgXhZyDD8/dnevVvF4vAU4q7eT4cUx3iQRgFcG5mN8ahY32F10zngoCYitnwXFpuhTz9H3A7iiSXrhXvDSDWNF1fDcmLarFrT+dyMQBF7niSud50MHtnDgHw2cw00QIXwB37oYw=