Skip to content

fix: symfony compatibility issue #40

fix: symfony compatibility issue

fix: symfony compatibility issue #40

Workflow file for this run

name: PHPUnit
on:
push:
branches: [master, gha]
pull_request:
branches: [master]
jobs:
phpunit:
name: Using PHP ${{ matrix.php-versions }}
# runs-on: self-hosted
runs-on: ubuntu-20.04
strategy:
matrix:
operating-system: ["self-hosted"]
php-versions: ["7.0", "7.4", "8.0", "8.3"]
env:
COMPOSER_ALLOW_SUPERUSER: "1"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit
coverage: xdebug
extensions: xml, curl
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-source --no-interaction
env:
PHP_VERSION: ${{ matrix.php-versions }}
- name: Run test
run: |
if [[ ${PHP_VERSION:0:1} == "7" ]]; then
./vendor/bin/phpunit --whitelist ./src --coverage-text --coverage-clover=coverage.clover
else
./vendor/bin/phpunit --whitelist ./src
fi
env:
PHP_VERSION: ${{ matrix.php-versions }}
XDEBUG_MODE: coverage
- name: Update coverage
env:
PHP_VERSION: ${{ matrix.php-versions }}
run: |
if [[ ${PHP_VERSION:0:1} == "7" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
if [[ ${PHP_VERSION:0:1} == "7" ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi