Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not run tests on TravisCI which are also run as GitHub Actions #445

Merged
merged 1 commit into from
Oct 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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