Skip to content

PHP CI

PHP CI #875

Workflow file for this run

name: PHP CI
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1', '8.2' ]
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: |
composer self-update
composer install --prefer-dist --no-progress --no-suggest --no-plugins
- name: Execute tests
run: vendor/bin/phpunit
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: xdebug
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: |
composer self-update
composer install --prefer-dist --no-progress --no-suggest --no-plugins
- name: Execute coverage
run: vendor/bin/phpunit --coverage-clover clover.xml
- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)