Skip to content

Laravel 11

Laravel 11 #58

Workflow file for this run

name: "tests"
on:
workflow_dispatch:
push:
branches:
- main
- master
paths-ignore:
- '**.md'
- '**.yml'
pull_request:
paths-ignore:
- '**.md'
- '**.yml'
jobs:
tests:
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
runs-on: ubuntu-latest
env:
CC_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
strategy:
fail-fast: true
matrix:
php: [ '8.1','8.2', '8.3' ]
stability: [ prefer-lowest, prefer-stable ]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: pcov
- name: Setup Problem Matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
if: ${{ !env.ACT }}
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.stability }}-${{ matrix.php }} }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.stability }}-${{ matrix.php }}
if: ${{ !env.ACT }}
- name: Install PHP Dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --quiet
- name: Execute PHPUnit
run: vendor/bin/phpunit
if: ${{ !env.CC_TOKEN || (matrix.stability != 'prefer-stable' && matrix.php != '8.2') }}
- name: Execute PHPUnit for codeclimate
run: vendor/bin/phpunit --coverage-clover=coverage.xml
if: ${{ env.CC_TOKEN && matrix.stability == 'prefer-stable' && matrix.php == '8.2' }}
- name: Upload coverage to codeclimate
uses: paambaati/codeclimate-action@v3.1.1
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ env.CC_TOKEN }}
with:
coverageCommand: ''
coverageLocations: ./coverage.xml:clover
if: ${{ env.CC_TOKEN && matrix.stability == 'prefer-stable' && matrix.php == '8.2' }}