Skip to content

Commit

Permalink
chore(workflows): update tests.yml
Browse files Browse the repository at this point in the history
- Uncomment strategy
- Modify PHP and Laravel versions
- Update Composer dependencies
- Execute tests
  • Loading branch information
guanguans committed Aug 12, 2023
1 parent 3d62165 commit ccc20f8
Showing 1 changed file with 97 additions and 28 deletions.
125 changes: 97 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,88 @@ on: [ push, pull_request ]
jobs:
test:
runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: true
# matrix:
# os: [ ubuntu-latest ]
# php: [ 7.4, 8.2 ]
# dependency-version: [ prefer-stable ]
# laravel: [ 7.*, 8.*, 9.*, 10.* ]
# include:
# - laravel: 10.*
# testbench: 8.*
# - laravel: 9.*
# testbench: 7.*
# - laravel: 8.*
# testbench: 6.*
# - laravel: 7.*
# testbench: 5.*
# exclude:
# - laravel: 8.*
# php: 8.0
# dependency-version: prefer-lowest
# - laravel: 8.*
# php: 8.2
# dependency-version: prefer-lowest
# - laravel: 6.*
# php: 8.2
# - laravel: 10.*
# php: 8.0
#
# name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [ ubuntu-latest ]
php: [ 7.4, 8.2 ]
dependency-version: [ prefer-stable ]
laravel: [ 7.*, 8.*, 9.*, 10.* ]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
php: [ "8.2", "8.1", "8.0", "7.4" ]
packages:
# All versions below should be test on PHP ^7.1 (Sentry SDK requirement) and PHP < 8.0 (PHPUnit requirement)
# - { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
- { laravel: ^7.0, testbench: 5.1.*, phpunit: 8.4.* }

# All versions below only support PHP ^7.3 (Laravel requirement)
- { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }

# All versions below only support PHP ^8.0 (Laravel requirement)
- { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }

# All versions below only support PHP ^8.1 (Laravel requirement)
- { laravel: ^10.0, testbench: ^8.0, phpunit: 9.6.* }
exclude:
- laravel: 8.*
php: 8.0
dependency-version: prefer-lowest
- laravel: 8.*
php: 8.2
dependency-version: prefer-lowest
- laravel: 6.*
php: 8.2
- laravel: 10.*
php: 8.0

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
# - php: "7.2"
# packages: { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }
# - php: "7.2"
# packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
# - php: "7.2"
# packages: { laravel: ^10.0, testbench: ^8.0, phpunit: 9.6.* }
#
# - php: "7.3"
# packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
# - php: "7.3"
# packages: { laravel: ^10.0, testbench: ^8.0, phpunit: 9.6.* }

- php: "7.4"
packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
- php: "7.4"
packages: { laravel: ^10.0, testbench: ^8.0, phpunit: 9.6.* }

# - php: "8.0"
# packages: { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
- php: "8.0"
packages: { laravel: ^7.0, testbench: 5.1.*, phpunit: 8.4.* }
- php: "8.0"
packages: { laravel: ^10.0, testbench: ^8.0, phpunit: 9.6.* }

# - php: "8.1"
# packages: { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
- php: "8.1"
packages: { laravel: ^7.0, testbench: 5.1.*, phpunit: 8.4.* }

# - php: "8.2"
# packages: { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
- php: "8.2"
packages: { laravel: ^7.0, testbench: 5.1.*, phpunit: 8.4.* }

name: phpunit (PHP:${{ matrix.php }}, Laravel:${{ matrix.packages.laravel }})

steps:
- name: Checkout code
Expand All @@ -52,8 +105,24 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: xdebug

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --ansi -v
# - name: Install dependencies
# run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --ansi -v

- name: Install Composer dependencies
run: |
# No need for this package to run phpunit and it conflicts with older Laravel versions
# composer remove friendsofphp/php-cs-fixer --dev --no-interaction --no-update
# Require the correct versions we want to run phpunit for
composer require \
"laravel/framework:${{ matrix.packages.laravel }}" \
"illuminate/support:${{ matrix.packages.laravel }}" \
"phpunit/phpunit:${{ matrix.packages.phpunit }}" \
"orchestra/testbench:${{ matrix.packages.testbench }}" \
--no-interaction --no-update
# Actually run the composer installation
composer install --no-interaction --prefer-dist --no-progress
- name: Execute tests
run: composer test-coverage
Expand Down

0 comments on commit ccc20f8

Please sign in to comment.