Skip to content

run-tests

run-tests #170

Workflow file for this run

name: run-tests
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.3, 8.2, 8.1, 8.0]
laravel: ["^11.0", "^10.0", "^9.0", "^8.0"]
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- laravel: "^11.0"
php: 8.1
- laravel: "^11.0"
php: 8.0
- laravel: "^10.0"
php: 8.0
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
coverage: xdebug
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests - with coverage
id: test
if: matrix.dependency-version == 'prefer-stable' && matrix.php == 8.3 && matrix.laravel == '^11.0'
run: vendor/bin/pest --coverage
- name: Execute tests - without coverage
if: steps.test.outcome == 'skipped'
run: vendor/bin/pest
- name: Upload coverage reports to Codecov
if: steps.test.outcome == 'success'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.xml
verbose: true