Skip to content

Fix xdebug version in workflow #23

Fix xdebug version in workflow

Fix xdebug version in workflow #23

Workflow file for this run

name: build and test
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.0', '7.4', '8.0', '8.3']
max-parallel: 2
steps:
- uses: actions/checkout@v4
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: php-${{ matrix.version }}-${{ github.ref }}
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: composer install --prefer-dist --no-progress
test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.0', '7.4', '8.0', '8.3']
max-parallel: 1
steps:
- uses: actions/checkout@v4
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
coverage: ${{ startsWith(matrix.version, '7.') && 'xdebug2' || 'xdebug3' }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: php-${{ matrix.version }}-${{ github.ref }}
- name: Run test suite
run: php vendor/bin/phpunit --coverage-clover=coverage.xml --whitelist=./src ./tests
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: coverage.xml
overwrite: true
retention-days: 1
coverage_upload:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download code coverage results
uses: actions/download-artifact@v4
with:
name: code-coverage-report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true