Skip to content

Commit

Permalink
ci: use simple-phpunit on lowest (#6316)
Browse files Browse the repository at this point in the history
* ci: use simple-phpunit on lowest

* ci: phpunit-bridge version constraint

* ci: fix guides database removal

* force lower phpunit version
  • Loading branch information
soyuka committed Apr 15, 2024
1 parent b50d3b8 commit b77e7ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,8 @@ jobs:
name: PHPUnit (PHP ${{ matrix.php }}) (Symfony lowest)
runs-on: ubuntu-latest
timeout-minutes: 20
env:
SYMFONY_PHPUNIT_VERSION: '9.5'
strategy:
matrix:
php:
Expand Down Expand Up @@ -1027,10 +1029,12 @@ jobs:
run: rm -Rf tests/Fixtures/app/var/cache/*
- name: Update project dependencies
run: composer update --prefer-lowest --no-interaction --no-progress --ansi
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Clear test app cache
run: tests/Fixtures/app/console cache:clear --ansi
- name: Run PHPUnit tests
run: vendor/bin/phpunit
run: vendor/bin/simple-phpunit
env:
SYMFONY_DEPRECATIONS_HELPER: max[self]=0&ignoreFile=./tests/.ignored-deprecations

Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/guides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ jobs:
KERNEL_CLASS: \ApiPlatform\Playground\Kernel
run: |
for d in guides/*.php; do
rm -f var/data.db
echo "Testing guide $d"
pdg-phpunit $d || exit 1
rm -f var/*.db
echo "Testing guide $d"
pdg-phpunit $d || exit 1
exit_status=$?
if [ $exit_status -ne 0 ]; then
exit $exit_status
fi
done
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"willdurand/negotiation": "^3.0"
},
"require-dev": {
"soyuka/pmu": "^0.0.2",
"behat/behat": "^3.11",
"behat/mink": "^1.9",
"doctrine/cache": "^1.11 || ^2.1",
Expand Down Expand Up @@ -68,6 +67,7 @@
"ramsey/uuid-doctrine": "^1.4 || ^2.0",
"sebastian/comparator": "<5.0",
"soyuka/contexts": "v3.3.9",
"soyuka/pmu": "^0.0.2",
"soyuka/stubs-mongodb": "^1.0",
"symfony/asset": "^6.4 || ^7.0",
"symfony/browser-kit": "^6.4 || ^7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ final class AttributeFilterPass implements CompilerPassInterface
public function process(ContainerBuilder $container): void
{
foreach (get_declared_classes() as $class) {
$this->createFilterDefinitions(new \ReflectionClass($class), $container);
$r = new \ReflectionClass($class);
if (str_contains((string) $r->getFileName(), 'guides')) {
$this->createFilterDefinitions($r, $container);
}
}
}

Expand Down

0 comments on commit b77e7ab

Please sign in to comment.