Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mtvbrianking committed Apr 15, 2024
1 parent 19f1187 commit 78946c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ jobs:

runs-on: ubuntu-latest


strategy:
fail-fast: true
matrix:
php: [8.0, 8.1, '8.2']
laravel: ['11.0', ^7.0, ^8.0, ^9.0, ^10.0]
laravel: [^7.0, ^8.0, ^9.0, ^10.0, '11.0']
include:
- laravel: ^10.0
testbench: ^8.0
Expand All @@ -31,27 +30,26 @@ jobs:
- laravel: '11.0'
testbench: ^9.0
exclude:
- laravel: ^10.0
php: 8.0
- laravel: ^7.0
php: 8.1
- laravel: '11.0'
php: 8.0
- laravel: '11.0'
php: 8.1

- laravel: ^10.0
php: 8.0
- laravel: ^7.0
php: 8.1
- laravel: ^7.0
php: 8.2

name: TESTS PHP ${{ matrix.php }} LARAVEL ${{ matrix.laravel }} TESTBENCH ${{ matrix.testbench }}


steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false


- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -60,33 +58,28 @@ jobs:
tools: composer:v2
coverage: pcov


- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}


- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-progress --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Create tests database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests, generate code coverage report
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover


- name: Save code coverage report
uses: actions/upload-artifact@v3
with:
Expand All @@ -98,33 +91,27 @@ jobs:

runs-on: ubuntu-latest


strategy:
fail-fast: true
matrix:
php: [7.4, '8.2']


name: Coverage P${{ matrix.php }}


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


- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}


- name: Retrieve code coverage report
uses: actions/download-artifact@v3
with:
name: coverage


- name: Upload code coverage report
run: |
wget https://scrutinizer-ci.com/ocular.phar
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"friendsofphp/php-cs-fixer": "^3.14",
"laravel/framework": "^10.0|^11.0",
"orchestra/testbench": "^8.0|^9.0",
"phpunit/phpunit": "^8.4|^9.0|^10.0"
"phpunit/phpunit": "^8.4|^9.0|^10.0|^11.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 78946c6

Please sign in to comment.