Skip to content

Always get a fresh AppInstance instance when testing topic subscriptions #1190

Always get a fresh AppInstance instance when testing topic subscriptions

Always get a fresh AppInstance instance when testing topic subscriptions #1190

Workflow file for this run

name: Tests
on:
pull_request:
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/tests.yml'
- 'composer.json'
push:
branches: ['7.x']
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/tests.yml'
- 'composer.json'
workflow_dispatch:
jobs:
tests:
name: "PHP ${{ matrix.php }}, ${{ matrix.dependencies }} deps"
runs-on: ubuntu-latest
strategy:
matrix:
php:
- "8.1"
- "8.2"
- "8.3"
dependencies:
- "lowest"
- "highest"
include:
- php: "8.4"
composer-options: "--ignore-platform-reqs"
dependencies: "highest"
env:
extensions: ctype, dom, grpc, json, mbstring, openssl, xml, zip, zlib
key: cache-unit-7x-${{ matrix.php }}-v1
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/[email protected]
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
tools: composer, pecl
coverage: xdebug
- uses: "ramsey/composer-install@v3"
with:
composer-options: "${{ matrix.composer-options }}"
dependency-versions: "${{ matrix.dependencies }}"
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Run PHPStan
run: XDEBUG_MODE=off vendor/bin/phpstan analyse --no-progress
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run PHPUnit
run: vendor/bin/phpunit --testsuite=unit --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox
- name: Upload code coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
bc-checks:
name: Backward Compatibility Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: grpc
- name: Install roave/backward-compatibility-check.
run: composer require --dev roave/backward-compatibility-check
- name: Check for BC breaks
run: vendor/bin/roave-backward-compatibility-check --format=github-actions