Skip to content

Commit

Permalink
Merge pull request #226 from avvertix/travis-ci-for-6.x
Browse files Browse the repository at this point in the history
Advanced Travis CI configuration to test on multiple versions of the Laravel framework
  • Loading branch information
franzose committed Apr 17, 2020
2 parents aad2b6f + 269b495 commit c745f9f
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 9 deletions.
82 changes: 76 additions & 6 deletions .travis.yml
@@ -1,21 +1,91 @@
language: php

services:
- mysql

php:
- 5.4
- 5.5
- 5.6
- hhvm
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

env:
- LARAVEL_VERSION=5.4.*
- LARAVEL_VERSION=5.5.*
- LARAVEL_VERSION=5.6.*
- LARAVEL_VERSION=5.7.*
- LARAVEL_VERSION=5.8.*
- LARAVEL_VERSION=6.*
- LARAVEL_VERSION=7.*

matrix:
exclude:
- php: 5.6
env: LARAVEL_VERSION=5.5.*
- php: 5.6
env: LARAVEL_VERSION=5.6.*
- php: 7.0
env: LARAVEL_VERSION=5.6.*
- php: 7.4
env: LARAVEL_VERSION=5.6.*
- php: 5.6
env: LARAVEL_VERSION=5.7.*
- php: 7.0
env: LARAVEL_VERSION=5.7.*
- php: 7.4
env: LARAVEL_VERSION=5.7.*
- php: 5.6
env: LARAVEL_VERSION=5.8.*
- php: 7.0
env: LARAVEL_VERSION=5.8.*
- php: 7.1
env: LARAVEL_VERSION=5.8.*
- php: 5.6
env: LARAVEL_VERSION=6.*
- php: 7.0
env: LARAVEL_VERSION=6.*
- php: 7.1
env: LARAVEL_VERSION=6.*
- php: 5.6
env: LARAVEL_VERSION=7.*
- php: 7.0
env: LARAVEL_VERSION=7.*
- php: 7.1
env: LARAVEL_VERSION=7.*
- php: 7.1
env: LARAVEL_VERSION=5.4.*
- php: 7.2
env: LARAVEL_VERSION=5.4.*
- php: 7.3
env: LARAVEL_VERSION=5.4.*
- php: 7.4
env: LARAVEL_VERSION=5.4.*

jobs:
fast_finish: true

sudo: false

install: travis_retry composer install --no-interaction --prefer-source
# ensure that the specific Laravel version is required
before_install:
- composer require "laravel/framework:${LARAVEL_VERSION}" --no-update

install: composer update --no-interaction --prefer-dist

before_script:
- mysql -e 'create database closuretabletest;'
- php ./tests/script-change-testcase-return-type.php

script: vendor/bin/phpunit
script:
- vendor/bin/phpunit

branches:
only:
- master
- feature/laravel-5
- 6.x
- travis-ci-for-6.x
# version tag, e.g. v1.0.0
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
- /^\d+\.\d+?$/
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -15,8 +15,8 @@
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "^6",
"orchestra/testbench": "^3.5"
"phpunit/phpunit": "^5.0|^6.0|^7.0|^8.0",
"orchestra/testbench": "^3.4|^4.0|^5.0"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
syntaxCheck="true"
>
<testsuites>
<testsuite name="Package Test Suite">
Expand Down
8 changes: 8 additions & 0 deletions tests/script-change-testcase-return-type.php
@@ -0,0 +1,8 @@
<?php

if(version_compare(phpversion(), '7.1', '<')){
exit(0);
}

file_put_contents('tests/BaseTestCase.php', str_replace('public function setUp()', 'public function setUp(): void', file_get_contents('tests/BaseTestCase.php')));
file_put_contents('tests/BaseTestCase.php', str_replace('public function tearDown()', 'public function tearDown(): void', file_get_contents('tests/BaseTestCase.php')));

0 comments on commit c745f9f

Please sign in to comment.