Skip to content

Correct build badge

Correct build badge #6

Workflow file for this run

name: CI
on:
pull_request: ~
push:
branches: [ main ]
jobs:
check-style:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Install dependencies
run: composer install
- name: Check code style
run: composer run check
test-code:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
minimum_versions: [ false ]
coverage: [ 'none' ]
include:
- description: Minimum version
php: '7.3'
minimum_versions: true
- description: Code coverage
php: '8.2'
coverage: pcov
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}
- name: Install dependencies
run: composer install
if: matrix.minimum_versions == false
- name: Install dependencies (minimum versions)
run: composer update --no-interaction --prefer-lowest
if: matrix.minimum_versions == true
- name: Run tests
run: vendor/bin/phpunit --no-coverage
if: matrix.coverage == 'none'
- name: Run tests with code coverage
run: vendor/bin/phpunit --exclude-group proxy --coverage-clover=coverage.xml
if: matrix.coverage == 'pcov'
- name: Upload code coverage report
uses: codecov/codecov-action@v4-beta
if: matrix.coverage == 'pcov'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: coverage.xml
fail_ci_if_error: true