Skip to content

Enable test workflow pipeline for all branches and PRs #1

Enable test workflow pipeline for all branches and PRs

Enable test workflow pipeline for all branches and PRs #1

Workflow file for this run

name: PHP Tests
on:
pull_request:
push:
permissions:
contents: read
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-version: ['8.2', '8.3']
name: PHP ${{ matrix.php-version }} test on ${{ matrix.operating-system }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install PHP
id: php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Check PHP version
run: php -v
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.operating-system }}-php-${{ steps.php.outputs.php-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.operating-system }}-php-${{ steps.php.outputs.php-version }}
- if: steps.composer-cache.outputs.cache-hit != 'true'
name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
- name: PHPUnit Tests
run: vendor/bin/phpunit --coverage-clover ./tests/coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tests/coverage.xml
flags: os-${{ matrix.operating-system }}_php-${{ matrix.php-version }}
verbose: true