Skip to content

Commit 51b503c

Browse files
authored
Merge pull request #121 from maxmind/andy/better-travis-yaml
Set env vars in travis matrix instead of hardcoding php versions
2 parents 97c2bec + 456f308 commit 51b503c

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.travis.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,36 @@
22
sudo: false
33
language: php
44
dist: trusty
5-
php:
6-
- '5.4'
7-
- '5.5'
8-
- '5.6'
9-
- '7.0'
10-
- '7.1'
11-
- '7.2'
12-
- hhvm
13-
- nightly
145
matrix:
6+
include:
7+
- php: '5.4'
8+
- php: '5.5'
9+
- php: '5.6'
10+
- php: '7.0'
11+
- php: '7.1'
12+
- php: '7.2'
13+
env:
14+
- RUN_LINTER=1
15+
- RUN_SNYK=1
16+
- php: hhvm
17+
- php: nightly
1518
allow_failures:
1619
- php: nightly
1720
before_install:
1821
- composer install --dev -n --prefer-source
1922
- phpenv rehash
20-
- "if [[ $TRAVIS_PHP_VERSION == '7.2' ]]; then sudo apt install -y nodejs; npm install -g snyk; fi"
23+
- "if [[ $RUN_SNYK ]]; then sudo apt-get install -y nodejs; npm install -g snyk; fi"
2124
install:
22-
- "if [[ $TRAVIS_PHP_VERSION == '7.2' ]]; then snyk test --org=maxmind; fi"
25+
- "if [[ $RUN_SNYK ]]; then snyk test --org=maxmind; fi"
2326
script:
2427
- mkdir -p build/logs
25-
- "if [[ $TRAVIS_PHP_VERSION = '7.2' ]]; then vendor/bin/php-cs-fixer fix --verbose --diff --dry-run --config=.php_cs; fi"
26-
- "if [[ $TRAVIS_PHP_VERSION = '7.2' ]]; then vendor/bin/phpcs --standard=PSR2 src/; fi"
28+
- "if [[ $RUN_LINTER ]]; then vendor/bin/php-cs-fixer fix --verbose --diff --dry-run --config=.php_cs; fi"
29+
- "if [[ $RUN_LINTER ]]; then vendor/bin/phpcs --standard=PSR2 src/; fi"
2730
- vendor/bin/phpunit -c phpunit.xml.dist
2831
after_script:
2932
- php vendor/bin/coveralls
3033
after_success:
31-
- "if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' && $TRAVIS_PHP_VERSION == '7.2' ]]; then snyk monitor --org=maxmind --project-name=maxmind/GeoIP2-php; fi"
34+
- "if [[ $RUN_SNYK && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then snyk monitor --org=maxmind --project-name=maxmind/GeoIP2-php; fi"
3235
notifications:
3336
email:
3437
on_failure: always

0 commit comments

Comments
 (0)