Create hotfix-to-release.yml #24
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
name: Package Test | |
on: [ push, pull_request ] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 3 | |
matrix: | |
php: | |
- '7.2' | |
- '7.3' | |
- '7.4' | |
- '8.0' | |
analysis: [ false ] | |
coverage: [ 'none' ] | |
normalize: [ false ] | |
validate: [ false ] | |
laravel: | |
- '7.0' | |
- '8.22' | |
- '9.0' | |
exclude: | |
- php: '7.2' | |
laravel: '8.22' | |
- php: '8.0' | |
laravel: '7.0' | |
- php: '8.0' | |
laravel: '8.22' | |
- php: '7.2' | |
laravel: '9.0' | |
- php: '7.3' | |
laravel: '9.0' | |
- php: '7.4' | |
laravel: '9.0' | |
include: | |
- php: '8.0' | |
laravel: '8.22' | |
analysis: true | |
coverage: 'xdebug' | |
normalize: true | |
validate: true | |
name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: ${{ matrix.coverage }} | |
extensions: dom, fileinfo, json, mbstring, pdo_sqlite | |
- name: Validate composer setup | |
if: matrix.validate == true | |
run: composer validate --strict | |
- name: Install Laravel legacy factories support | |
if: matrix.laravel == '8.22' | |
run: composer require "laravel/legacy-factories:^1.1" --dev --no-interaction --no-update | |
- name: Install Laravel and Orchestra Testbench | |
run: composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: "php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}" | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Normalize composer file | |
if: matrix.normalize == true && matrix.php != '8.0' | |
run: composer normalize --dry-run | |
- name: Run test suite | |
run: vendor/bin/phpunit -v | |
- name: Run static code analysis | |
if: matrix.analysis == true | |
run: vendor/bin/phpstan --memory-limit=-1 | |
- name: Upload coverage results | |
uses: codecov/codecov-action@v1 | |
if: matrix.coverage != 'none' |