|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + |
| 9 | + services: |
| 10 | + mysql: |
| 11 | + image: mysql:5.7 |
| 12 | + ports: |
| 13 | + - '3306:3306' |
| 14 | + env: |
| 15 | + MYSQL_DATABASE: testing |
| 16 | + MYSQL_USER: testing |
| 17 | + MYSQL_PASSWORD: testing |
| 18 | + MYSQL_ROOT_PASSWORD: testing |
| 19 | + options: >- |
| 20 | + --health-cmd="mysqladmin ping" |
| 21 | + --health-interval=10s |
| 22 | + --health-timeout=30s |
| 23 | + --health-retries=5 |
| 24 | +
|
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + php: [7.1, 7.2, 7.3, 7.4, 8.0] |
| 28 | + lib: |
| 29 | + - { laravel: ^8.0, testbench: ^6.0, composer_flags: --prefer-stable } |
| 30 | + - { laravel: ^7.0, testbench: ^5.0, composer_flags: --prefer-stable } |
| 31 | + - { laravel: ^6.0, testbench: ^4.0, composer_flags: --prefer-stable } |
| 32 | + - { laravel: ^6.0, testbench: ^4.0, composer_flags: --prefer-stable --prefer-lowest } |
| 33 | + - { laravel: 5.8.*, testbench: 3.8.*, composer_flags: --prefer-stable } |
| 34 | + exclude: |
| 35 | + - lib: { laravel: ^8.0, testbench: ^6.0, composer_flags: --prefer-stable } |
| 36 | + php: 7.2 |
| 37 | + - lib: { laravel: ^8.0, testbench: ^6.0, composer_flags: --prefer-stable } |
| 38 | + php: 7.1 |
| 39 | + - lib: { laravel: ^7.0, testbench: ^5.0, composer_flags: --prefer-stable } |
| 40 | + php: 7.1 |
| 41 | + - lib: { laravel: ^6.0, testbench: ^4.0, composer_flags: --prefer-stable } |
| 42 | + php: 7.1 |
| 43 | + - lib: { laravel: ^6.0, testbench: ^4.0, composer_flags: --prefer-stable --prefer-lowest } |
| 44 | + php: 7.1 |
| 45 | + - lib: { laravel: 5.8.*, testbench: 3.8.*, composer_flags: --prefer-stable } |
| 46 | + php: 8.0 |
| 47 | + - lib: { laravel: 5.7.*, testbench: 3.7.*, composer_flags: --prefer-stable } |
| 48 | + php: 8.0 |
| 49 | + - lib: { laravel: 5.6.*, testbench: 3.6.*, composer_flags: --prefer-stable } |
| 50 | + php: 8.0 |
| 51 | + |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v2 |
| 54 | + |
| 55 | + - name: Setup PHP |
| 56 | + uses: shivammathur/setup-php@v2 |
| 57 | + with: |
| 58 | + php-version: ${{ matrix.php }} |
| 59 | + coverage: xdebug |
| 60 | + |
| 61 | + - name: Adjust Package Versions |
| 62 | + run: | |
| 63 | + composer require "laravel/framework:${{ matrix.lib.laravel }}" --dev --no-update ${{ matrix.lib.composer_flags }} |
| 64 | + if php -r 'exit((int)!version_compare(PHP_VERSION, "8", ">="));'; then |
| 65 | + composer require "orchestra/testbench:>=4.14" --dev --no-update ${{ matrix.lib.composer_flags }} |
| 66 | + composer require "phpunit/phpunit:>=9.3" --dev --no-update ${{ matrix.lib.composer_flags }} |
| 67 | + else |
| 68 | + composer require "orchestra/testbench:${{ matrix.lib.testbench }}" --dev --no-update ${{ matrix.lib.composer_flags }} |
| 69 | + fi |
| 70 | + composer update ${{ matrix.lib.composer_flags }} |
| 71 | +
|
| 72 | + - run: mkdir -p build/logs |
| 73 | + - run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml |
| 74 | + |
| 75 | + - name: Upload Coverage |
| 76 | + uses: nick-invision/retry@v2 |
| 77 | + env: |
| 78 | + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + with: |
| 80 | + timeout_minutes: 1 |
| 81 | + max_attempts: 3 |
| 82 | + command: | |
| 83 | + composer global require php-coveralls/php-coveralls |
| 84 | + php-coveralls --coverage_clover=build/logs/clover.xml -v |
0 commit comments