Skip to content

Commit

Permalink
[Travis] Created Travis configuration (#6)
Browse files Browse the repository at this point in the history
* [Composer] Added test script executing unit tests

* [Travis] Created .travis.yml

* [Travis] Enabled Slack notifications
  • Loading branch information
alongosz authored Apr 18, 2019
1 parent 0526533 commit e3f98f8
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
56 changes: 56 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
language: php
dist: xenial

services:
- mysql

cache:
directories:
- $HOME/.composer/cache/files

matrix:
fast_finish: true
include:
- name: 'Unit tests on PHP 7.1'
php: '7.1'
env: CMD='composer test' MYSQL_DATABASE_URL='mysql://root@localhost/testdb'
- name: 'Unit tests on PHP 7.3'
php: '7.3'
env: CMD='composer test' MYSQL_DATABASE_URL='mysql://root@localhost/testdb'
- name: 'Code Style validation'
php: '7.3'
env: CMD='php ./vendor/bin/php-cs-fixer fix --dry-run -v --show-progress=estimating'

# test only master, stable branches and pull requests
branches:
only:
- master
- /^\d.\d+$/

before_install:
# Disable memory_limit for composer
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Create MySQL database for tests
- mysql -e 'CREATE DATABASE testdb;'

install:
- travis_retry composer install --no-progress --no-interaction --prefer-dist

script:
- composer validate
- "$CMD"

# reduce depth (history) of git checkout
git:
depth: 10

notifications:
# disable mail notifications
email: false
# enable Slack notifications
slack:
rooms:
- secure: "kGZo5sQOIOn1Sk0GtDBw9hf5zVNCQgxPV2BrA8vRYAi9NcpMOFQ83r36o51ohsKLXXZFnoAK5egUZt2AWAXOq3U8mWReyXMmaUWvILXFG3YYMMB4Fr4pcwxZ2sIuaB5a+/rPNf0Cha0oqD1MjOQIJuQ7715fmLk4ooYjk/cBNUdZZJRhOONu/oWGaFy6qL17RWW+bK/3Vv0EQcoNVTgyGIOIvX1RXpw+BP7q1Gl0UkzuNDD7b91JQ5l+X1K1BEAQe8SigIRw+qcgfRnTVdpHaySAhAroRs4t0VMxu2jbT/9X8SjQoog2RfssYsJlpLptNYx8Ib2m8GYuApIBEz6qcku9FKgY2Paw30sxT+OhoNZKSo6D6eVc7e7rdwoTgjJLGOaYFYLr5vZJeBH9qap1AgYV4OhKjFkraLGKBxcGwjNrHpJj7Nu6eYvuBI0anmwS86jVIdTGH8GPQnpi42QiMRbTPGm9VJ0PYE1wSniCbR1nsiZ+Uk04z4hKbrCG23SaOCLwZRMSBYCtKNPDpFPKXSNXVaFO9+v4fI1xVgzMHgPXWh3+h0dR+SAu6sd4rU8wADlyMiuCXA7kUENCUqjyMnTysnlJz440ea942dN/8M56EeOsMw0WJwGjMxgd7azAJrflf1IOZzji/NTlGiGKFWVAisnnnblcZShF5QgyQNI="
on_success: change
on_failure: always
on_pull_requests: false
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
}
},
"scripts": {
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating"
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating",
"test": "@php ./vendor/bin/phpunit -vc phpunit.xml"
},
"extra": {
"_ezplatform_branch_for_behat_tests": "master",
Expand Down

0 comments on commit e3f98f8

Please sign in to comment.