-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Travis] Created Travis configuration (#6)
* [Composer] Added test script executing unit tests * [Travis] Created .travis.yml * [Travis] Enabled Slack notifications
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters