Skip to content

Run coverage for PHP 8.4 #8

Run coverage for PHP 8.4

Run coverage for PHP 8.4 #8

Workflow file for this run

name: Run Tests
on:
push:
branches:
- gh-pages
- "**"
jobs:
test:
name: Test - PHP ${{ matrix.php }} - ${{ matrix.setup }}
runs-on: ubuntu-latest
env:
CC_TEST_REPORTER_ID: a706e45a0731ff71fe03470fefba2e1469a856018f131d0aee0be3f26ec4fc16
strategy:
matrix:
php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
setup: [lowest, stable]
include:
- php: nightly
setup: stable
fail-fast: false
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: ${{ matrix.php == 8.4 && matrix.setup && 'pcov' || 'none' }}
- name: Get composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache/Restore Composer
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: "php-${{ matrix.php }}-${{ matrix.setup }}-${{ matrix.os }}-${{ matrix.phpunit }}-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php }}-${{ matrix.setup }}-${{ matrix.os }}-${{ matrix.phpunit }}-${{ hashFiles('**/composer.json') }}"
- name: Set PHPUnit version
if: matrix.php >= 8.1
run: composer require "phpunit/phpunit:^8.5.41" --no-update
- name: Install Dependencies
run: composer update --prefer-dist --prefer-${{ matrix.setup }} --no-interaction --no-suggest
- name: Run Tests
run: vendor/bin/phpunit ${{ matrix.php == 8.4 && matrix.setup == 'stable' && '--coverage-clover=clover.xml --coverage-text --log-junit test-results.xml' || '' }}
- name: Upload Test Results
if: matrix.php == 8.4 && matrix.setup == 'stable'
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.php-version }}-phpunit-results"
path: test-results.xml
- name: Code Climate Test Reporter
if: matrix.php == 8.4 && matrix.setup == 'stable'
uses: aktions/codeclimate-test-reporter@v1
with:
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
command: after-build -t clover
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
continue-on-error: true
- name: Coverage
if: matrix.php == 8.4 && matrix.setup == 'stable'
uses: codecov/codecov-action@v5