Skip to content

Commit

Permalink
update the tests ci
Browse files Browse the repository at this point in the history
  • Loading branch information
salehhashemi1992 committed May 19, 2024
1 parent 85ee831 commit 75fb93f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 29 deletions.
42 changes: 19 additions & 23 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
name: run-tests
name: "Run Tests"

on:
push:
branches:
- "**"
pull_request:
types: [ready_for_review, synchronize, opened]
on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1]
laravel: [11.*, 10.*, 9.*]
stability: [prefer-lowest, prefer-stable]
php: [8.1, 8.2, 8.3]
laravel: [9.*, 10.*, 11.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
phpunit: 11.*

- laravel: 10.*
testbench: 8.*
phpunit: 11.*

- laravel: 9.*
testbench: 7.*
phpunit: 10.*

exclude:
- laravel: 11.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
- laravel: 9.*
php: 8.3

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

steps:
- name: Checkout code
Expand All @@ -38,21 +42,13 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
coverage: xdebug

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: List Installed Dependencies
run: composer show -D
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:>=2.62.1" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests with Coverage
run: vendor/bin/phpunit --coverage-clover=coverage.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Salehhashemi\OtpManager\OtpManagerServiceProvider;
use Salehhashemi\OtpManager\Tests\Enums\MyOtpEnum;

class FacadeOtpManagerTestCase extends TestCase
class FacadeOtpManagerTest extends TestCase
{
/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion tests/OtpDtoTestCase.php → tests/OtpDtoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Salehhashemi\OtpManager\Dto\OtpDto;

class OtpDtoTestCase extends TestCase
class OtpDtoTest extends TestCase
{
public function test_constructor_initializes_properties_correctly(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/OtpManagerTestCase.php → tests/OtpManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Salehhashemi\OtpManager\OtpManagerServiceProvider;
use Salehhashemi\OtpManager\Tests\Enums\MyOtpEnum;

class OtpManagerTestCase extends TestCase
class OtpManagerTest extends TestCase
{
/**
* {@inheritdoc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Salehhashemi\OtpManager\OtpManagerServiceProvider;
use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException;

class OtpRateLimiterTestCase extends TestCase
class OtpRateLimiterTest extends TestCase
{
/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion tests/SentOtpDtoTestCase.php → tests/SentOtpDtoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Salehhashemi\OtpManager\Dto\SentOtpDto;

class SentOtpDtoTestCase extends TestCase
class SentOtpDtoTest extends TestCase
{
public function test_constructor_initializes_properties_correctly(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Orchestra\Testbench\TestCase as BaseTestCase;
use Salehhashemi\OtpManager\OtpManagerServiceProvider;

abstract class TestCase extends BaseTestCase
class TestCase extends BaseTestCase
{
/**
* {@inheritdoc}
Expand Down

0 comments on commit 75fb93f

Please sign in to comment.