1
1
---
2
2
language : php
3
- php :
4
- - 5.6
5
- - 7
3
+
4
+ matrix :
5
+ include :
6
+ - env : TEST_EMBER=true
7
+ php : 7
8
+ - env : TEST_EMBER=false
9
+ php : 5.6
6
10
7
11
sudo : false
8
12
@@ -11,24 +15,45 @@ cache:
11
15
- node_modules
12
16
13
17
before_install :
14
- - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
15
- - " npm config set spin false"
16
- - " npm install -g npm@^2"
18
+ - if $TEST_EMBER; then export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH; fi
19
+ - if $TEST_EMBER; then npm config set spin false; fi
20
+ - if $TEST_EMBER; then npm install -g npm@^2; fi
17
21
18
22
install :
19
- - npm install -g bower
20
- - npm install
21
- - npm prune
22
- - bower install
23
- - cd api/ && composer install --no-dev && cd .. # install non development composer requirements for api
23
+ - if $TEST_EMBER; then npm install -g bower; fi
24
+ - if $TEST_EMBER; then npm install; fi
25
+ - if $TEST_EMBER; then npm prune; fi
26
+ - if $TEST_EMBER; then bower install; fi
27
+ # install non development composer requirements for api
28
+ - if $TEST_EMBER; then cd api/ && composer install --no-dev && cd ..; fi
24
29
25
30
before_script :
26
- - ember server --live-reload=false & # Start a server so we can hit the fake API from integration tests
27
- - sleep 10 # wait for the server to be started
28
- - echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini # http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data
29
- - npm list # list all installed npm packages
31
+ # Start a server so we can hit the API from integration tests
32
+ - if $TEST_EMBER; then ember server --live-reload=false; fi &
33
+ # wait for the server to be started
34
+ - if $TEST_EMBER; then sleep 10; fi
35
+ # http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data
36
+ - echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
37
+ # list all installed npm packages
38
+ - if $TEST_EMBER; then npm list; fi
39
+ # create a sauce tunnel
40
+ - if $TEST_EMBER; then ember start-sauce-connect; fi
30
41
31
42
script :
32
- - npm test # run frontend and integration tests
33
- - cd api/ && composer install && cd .. # install development requirements for api to run api tests
34
- - cd api/ && ./vendor/bin/codecept run && cd .. # run api tests with codeception
43
+ # run frontend and integration tests
44
+ - if $TEST_EMBER; then npm test; fi
45
+ # test against different browsers using sauce lab
46
+ # we can not run the integration tests against api cause api is not available to test instance running at sauce lab
47
+ # therefore we only run acceptance tests by filter
48
+ # to do so we can not just add the launcher to testem ci configuration
49
+ - if $TEST_EMBER; then ember test --launch='SL_chrome,SL_firefox,SL_edge,SL_ie,SL_safari' --test-port 8080 --filter 'Acceptance |'; fi
50
+ # install development requirements for api to run api tests
51
+ # not be done in install section cause otherwise integration tests would not fail
52
+ # if api needs an dependency in production which is specified as development dependency
53
+ - cd api/ && composer install && cd ..
54
+ # run api tests with composer
55
+ - cd api/ && ./vendor/bin/codecept run && cd ..
56
+
57
+ after_script :
58
+ # destroy the sauce tunnel
59
+ - if [$TEST_EMBER ]; then ember stop-sauce-connect; fi
0 commit comments