Skip to content

feat(worbench-setup): make plugin development self-contained #89

feat(worbench-setup): make plugin development self-contained

feat(worbench-setup): make plugin development self-contained #89

Workflow file for this run

name: Tests
on:
# Run testing on all push and pull requests for the main branch that have committed changes in PHP files
push:
branches: [ "main" ]
paths:
- '**.php'
pull_request:
branches: [ "main" ]
paths:
- '**.php'
# Make it possible to run the workflow manually
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
# Define the matrix of different PHP, Laravel, and testbench versions
strategy:
# Fail the whole workflow if one of the jobs fails
fail-fast: true
matrix:
php: [ 8.2, 8.3, 8.4 ]
laravel: [ 11.*, 12.* ]
dependency-version: [ prefer-stable ]
include:
# Laravel 12 uses Orchestra Testbench 10
- laravel: 12.*
testbench: 10.*
# Laravel 11 uses Orchestra Testbench 9
- laravel: 11.*
testbench: 9.*
name: PHP ${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }}
steps:
#- name: Configure operating system
# run: sudo apt-get update && sudo apt-get install -y locales locales-all
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
# extensions: mbstring, gd, intl
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "filament/support:^3.3" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction
- name: Run test suite
run: composer test -- --coverage-clover ./coverage.xml
- name: Upload coverage reports to Codecov
# Make sure the Codecov action is only executed once
if: matrix.php == '8.2' && matrix.laravel == '12.*' && matrix.dependency-version == 'prefer-stable'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
verbose: true