Skip to content

Commit

Permalink
Separate test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Nikolaou committed Nov 27, 2021
1 parent ee515e3 commit 1c2e95c
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 22 deletions.
41 changes: 19 additions & 22 deletions .github/workflows/tests.yml → .github/workflows/tests-php7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1, 8.0, 7.4, 7.3, 7.2, 7.1]
php: [7.4, 7.3, 7.2, 7.1]
laravel: [^8.0, ^7.0, ^6.0, 5.8.*, 5.7.*, 5.6.*, 5.5.*]
include:
- laravel: ^8.0
Expand All @@ -22,7 +22,7 @@ jobs:
phpunit: 8.5
- laravel: ^6.0
testbench: ^4.0
phpunit: 9.3
phpunit: 8.5
- laravel: 5.8.*
testbench: ^3.8
phpunit: 7.5
Expand All @@ -40,36 +40,16 @@ jobs:
php: 7.2
- laravel: ^8.0
php: 7.1
- laravel: ^7.0
php: 8.1
- laravel: ^7.0
php: 7.1
- laravel: ^6.0
php: 8.1
- laravel: ^6.0
php: 7.1
- laravel: 5.8.*
php: 8.1
- laravel: 5.8.*
php: 8.0
- laravel: 5.7.*
php: 8.1
- laravel: 5.7.*
php: 8.0
- laravel: 5.7.*
php: 7.4
- laravel: 5.6.*
php: 8.1
- laravel: 5.6.*
php: 8.0
- laravel: 5.6.*
php: 7.4
- laravel: 5.6.*
php: 7.3
- laravel: 5.5.*
php: 8.1
- laravel: 5.5.*
php: 8.0
- laravel: 5.5.*
php: 7.4

Expand All @@ -87,6 +67,23 @@ jobs:
tools: composer:v2
coverage: pcov

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-

- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:^${{ matrix.phpunit }}" --no-interaction --no-update
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/tests-php8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Tests

on:
push:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.1, 8.0]
laravel: [^8.0, '^7.0', ^6.0]
include:
- laravel: ^8.0
testbench: ^6.0
- laravel: ^7.0
testbench: ^5.0
- laravel: ^6.0
testbench: ^4.0
exclude:
- laravel: ^7.0
php: 8.1
- laravel: ^6.0
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: pcov

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: $p{{ matrix.php }}-l{{ matrix.laravel }}-composer-

- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --verbose --whitelist=src --coverage-clover=build/coverage/clover.xml

- name: Upload coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/coverage/clover.xml"

0 comments on commit 1c2e95c

Please sign in to comment.