Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Tests

on:
push:
merge_group:
jobs:
style:
runs-on: ubuntu-latest
defaults:
run:
shell: nix-shell --pure --run "bash -euxo pipefail {0}"
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
- run: composer install --ignore-platform-req=ext-redis
- run: vendor/bin/ecs
- run: bin/console cache:warmup
- run: bin/console lint:twig templates -n --format=github
- run: composer validate composer.json --no-check-publish
- run: symfony security:check
# symfony security:check
# vendor/bin/parallel-lint src public migrations config
# composer validate composer.json --no-check-publish
# XDEBUG_MODE=off bin/composer-require-checker --no-interaction --config-file=$PWD/composer-require-checker.json
# vendor/bin/config-transformer --dry-run
# bin/console lint:container -n
# bin/console cache:warmup
# bin/console lint:twig templates -n {{ if output == "github" { "--format=github" } else { "" } }}
# bin/console lint:yaml . *.yaml --parse-tags -n {{ if output == "github" { "--format=github" } else { "" } }}
# bin/console debug:translation --all --only-missing en
# bin/console lint:xliff translations --no-interaction {{ if output == "github" { "--format=github" } else { "" } }}
# vendor/bin/rector --dry-run
# vendor/bin/php-cs-fixer fix --dry-run --diff
# vendor/bin/psalm {{ if output == "github" { "--output-format=github" } else { "" } }}
# vendor/bin/phpstan -v --memory-limit=1G {{ if output == "github" { "--error-format=github" } else { "" } }}
# cd .. && pnpm spectral lint openapi.yaml {{ if output == "github" { "--format=github-actions" } else { "" } }}

psalm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
- shell: nix-shell --pure --run "bash -euxo pipefail {0}"
run: |
# TODO: cache composer dependencies
# TODO: check why --ignore-platform-req=ext-redis is needed
composer install --ignore-platform-req=ext-redis
vendor/bin/psalm --output-format=github

phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
# TODO: cache the build
- shell: nix-shell --pure --run "bash -euxo pipefail {0}"
run: |
# TODO: cache composer dependencies
# TODO: check why --ignore-platform-req=ext-redis is needed
composer install --ignore-platform-req=ext-redis
XDEBUG_MODE=coverage vendor/bin/phpunit --order-by=random --stop-on-error --stop-on-failure
3 changes: 2 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ lint:
vendor/bin/ecs

fix:
vendor/bin/ecs --fix
vendor/bin/ecs --fix
just --fmt --unstable
5 changes: 4 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
convertDeprecationsToExceptions="false"
executionOrder="depends,defects"
>
<php>
<ini name="display_errors" value="1" />
Expand All @@ -23,6 +23,8 @@
</testsuite>
</testsuites>

<!--
TODO: fix phpunit config
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
Expand All @@ -32,6 +34,7 @@
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
-->

<extensions>
</extensions>
Expand Down
81 changes: 81 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<files
psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4"
php-version="
php:8.3.2;
apcu:5.1.23;
bcmath:8.3.2;
calendar:8.3.2;
Core:8.3.2;
ctype:8.3.2;
curl:8.3.2;
date:8.3.2;
dom:20031129;
exif:8.3.2;
fileinfo:8.3.2;
filter:8.3.2;
ftp:8.3.2;
gd:8.3.2;
gettext:8.3.2;
gmp:8.3.2;
hash:8.3.2;
iconv:8.3.2;
imap:8.3.2;
intl:8.3.2;
json:8.3.2;
ldap:8.3.2;
libxml:8.3.2;
mbstring:8.3.2;
mysqli:8.3.2;
mysqlnd:mysqlnd 8.3.2;
openssl:8.3.2;
pcntl:8.3.2;
pcre:8.3.2;
PDO:8.3.2;
pdo_mysql:8.3.2;
PDO_ODBC:8.3.2;
pdo_pgsql:8.3.2;
pdo_sqlite:8.3.2;
pgsql:8.3.2;
Phar:8.3.2;
posix:8.3.2;
random:8.3.2;
readline:8.3.2;
redis:6.0.2;
Reflection:8.3.2;
session:8.3.2;
SimpleXML:8.3.2;
soap:8.3.2;
sockets:8.3.2;
sodium:8.3.2;
SPL:8.3.2;
sqlite3:8.3.2;
standard:8.3.2;
sysvsem:8.3.2;
tokenizer:8.3.2;
xml:8.3.2;
xmlreader:8.3.2;
xmlwriter:8.3.2;
Zend OPcache:8.3.2;
Zend OPcache:8.3.2;
zip:1.22.3;
zlib:8.3.2
"
>
<file src="src/Stripe/RemoteEventHandler.php">
<MixedMethodCall>
<code>__invoke</code>
</MixedMethodCall>
</file>
<file src="src/Stripe/UpdateProduct.php">
<RiskyTruthyFalsyComparison>
<code><![CDATA[$product->default_price]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="src/Stripe/UpdateSubscription.php">
<RiskyTruthyFalsyComparison>
<code><![CDATA[$subscription->cancel_at]]></code>
<code><![CDATA[$subscription->canceled_at]]></code>
</RiskyTruthyFalsyComparison>
</file>
</files>
4 changes: 3 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
findUnusedCode="true"
findUnusedPsalmSuppress="true"
findUnusedVariablesAndParams="true"
errorBaseline="psalm-baseline.xml"
includePhpVersionsInErrorBaseline="true"
>
<fileExtensions>
<extension name=".php" />
<extension name=".twig" checker="./vendor/psalm/plugin-symfony/src/Twig/TemplateFileAnalyzer.php"/>
<extension name=".twig" checker="/vendor/psalm/plugin-symfony/src/Twig/TemplateFileAnalyzer.php"/>
</fileExtensions>

<projectFiles>
Expand Down