-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sébastien Nikolaou
committed
Nov 27, 2021
1 parent
ee515e3
commit 1c2e95c
Showing
2 changed files
with
90 additions
and
22 deletions.
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
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,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" |