Skip to content

Try new gh workflow #33

Try new gh workflow

Try new gh workflow #33

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
php: 8.2
laravel: ^10
collision: ^7
testbench: ^8
stability: prefer-lowest
- os: ubuntu-latest
php: 8.2
laravel: ^10
collision: ^7
testbench: ^8
stability: prefer-stable
- os: ubuntu-latest
php: 8.2
laravel: ^11
collision: ^8
testbench: ^9
stability: prefer-lowest
- os: ubuntu-latest
php: 8.2
laravel: ^11
collision: ^8
testbench: ^9
stability: prefer-stable
- os: ubuntu-latest
php: 8.3
laravel: ^10
collision: ^7
testbench: ^8
stability: prefer-lowest
- os: ubuntu-latest
php: 8.3
laravel: ^10
collision: ^7
testbench: ^8
stability: prefer-stable
- os: ubuntu-latest
php: 8.3
laravel: ^11
collision: ^8
testbench: ^9
stability: prefer-lowest
- os: ubuntu-latest
php: 8.3
laravel: ^11
collision: ^8
testbench: ^9
stability: prefer-stable
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} - Laravel ${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
composer require --dev "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer require --dev "nunomaduro/collision:${{ matrix.collision }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest
coverage:
needs: [test]
name: coverage
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: [ubuntu-latest]
php: [8.3]
laravel: ^11
testbench: ^9
stability: [prefer-stable]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: xdebug
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: composer test-coverage
coverageLocations: |
${{github.workspace}}/build/logs/clover.xml:clover