Merge pull request #17 from FrittenKeeZ/migrations-cleanup #4
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: Linting & Testing | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- "**.json" | |
- "**.php" | |
- "**.yml" | |
pull_request: | |
branches: | |
- master | |
paths: | |
- "**.json" | |
- "**.php" | |
- "**.yml" | |
jobs: | |
laravel-pint: | |
name: PHP Linting (Pint) | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# Make sure the actual branch is checked out when running on pull requests. | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Laravel Pint | |
uses: aglipanci/[email protected] | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: PHP Linting (Pint) | |
skip_fetch: true | |
testing: | |
needs: laravel-pint | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.3, 8.2, 8.1] | |
testbench: [9.0, 8.0, 7.0] # Laravel 11.x, 10.x, 9.x | |
version: [prefer-stable, prefer-lowest] | |
include: | |
- testbench: 7.0 | |
phpunit: "-c phpunit-9.xml" | |
exclude: | |
- php: 8.1 | |
testbench: 9.0 | |
name: P${{ matrix.php }} - T${{ matrix.testbench }} - ${{ matrix.version }} | |
runs-on: ubuntu-latest | |
container: | |
image: kirschbaumdevelopment/laravel-test-runner:${{ matrix.php }} | |
options: "--user=root" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# Make sure the actual branch is checked out when running on pull requests. | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: | | |
composer require "orchestra/testbench:^${{ matrix.testbench }}" --no-interaction --no-update | |
composer update --${{ matrix.version }} --prefer-dist --no-interaction | |
- name: Execute tests | |
run: vendor/bin/phpunit ${{ matrix.phpunit }} |