Skip to content

Commit

Permalink
Merge pull request #445 from jelhan/remove-duplicated-tests-on-travis-ci
Browse files Browse the repository at this point in the history
do not run tests on TravisCI which are also run as GitHub Actions
  • Loading branch information
jelhan committed Oct 17, 2020
2 parents a940a18 + d1677c6 commit 05e3b00
Showing 1 changed file with 18 additions and 46 deletions.
64 changes: 18 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
---
language: php
# TravisCI is only used for BrowserStack tests.
# All other tests are run as GitHub Actions.

matrix:
include:
- env: TEST="API"
php: 7.3
- env: TEST="API"
php: 7.2
- env: TEST="API"
php: 7.1
- env: TEST="EMBER"
- env: TEST="BROWSER"
- env: TEST="BUNDLESIZE"
language: node_js
node_js:
- "10"

dist: trusty
sudo: false
dist: xenial

addons:
chrome: stable
firefox: latest-esr

cache:
yarn: true
Expand All @@ -27,44 +18,25 @@ env:
global:
- "BROWSERSTACK_USERNAME=jeldrikhanschke1"
- "BROWSERSTACK_ACCESS_KEY=xaM9Uxurv2GyxFLKQXgj"
# See https://git.io/vdao3 for details.
- JOBS=1

before_install:
# use a recent node version if ember build is tested
- if [ $TEST = "EMBER" ] || [ $TEST = "BROWSER" ] || [ $TEST = "BUNDLESIZE" ]; then nvm install --lts; fi
# provide yarn if ember build is tested
- if [ $TEST = "EMBER" ] || [ $TEST = "BROWSER" ] || [ $TEST = "BUNDLESIZE" ]; then curl -o- -L https://yarnpkg.com/install.sh | bash; fi
- if [ $TEST = "EMBER" ] || [ $TEST = "BROWSER" ] || [ $TEST = "BUNDLESIZE" ]; then export PATH=$HOME/.yarn/bin:$PATH; fi
branches:
only:
- master

install:
# install dependencies for client
- if [ $TEST = "EMBER" ] || [ $TEST = "BROWSER" ] || [ $TEST = "BUNDLESIZE" ]; then yarn install --no-interactive; fi
# install dependencies for api
- if [ $TEST = "API" ]; then cd api/ && composer install && cd ..; fi
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

before_script:
# http://php.net/manual/de/ini.core.php#ini.always-populate-raw-post-data
- if [ $TEST = "API" ]; then echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
# create a browser stack tunnel for cross-browser testing
- if [ $TEST = "BROWSER" ]; then node_modules/ember-cli/bin/ember browserstack:connect; fi

branches:
only:
- master
- node_modules/ember-cli/bin/ember browserstack:connect

script:
# run frontend and integration tests
- if [ $TEST = "EMBER" ]; then yarn run lint:hbs; fi
- if [ $TEST = "EMBER" ]; then yarn run lint:js; fi
- if [ $TEST = "EMBER" ]; then yarn test; fi
# test that CSP headers in public/.htaccess are matching the ones configured in config/environment.js
- if [ $TEST = "EMBER" ]; then grep "`node_modules/ember-cli/bin/ember csp-headers --environment production --silent 2>&1 | sed 's/ $//'`" public/.htaccess || (echo "CSP headers in public/.htaccess does not match configuration" && exit 1); fi
# test against different browsers using sauce lab
- if [ $TEST = "BROWSER" ]; then yarn test --config-file testem.browserstack.js; fi
# test bundle size
- if [ $TEST = "BUNDLESIZE" ]; then yarn test:bundlesize; fi
# run api tests with composer
- if [ $TEST = "API" ]; then cd api/ && ./vendor/bin/codecept run && cd ..; fi
# run tests on BrowserStack
- yarn test --config-file testem.browserstack.js

after_script:
# destroy the sauce tunnel
- if [ $TEST = "BROWSER" ]; then node_modules/ember-cli/bin/ember browserstack:disconnect; fi
- inode_modules/ember-cli/bin/ember browserstack:disconnect

0 comments on commit 05e3b00

Please sign in to comment.