Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit 4bb8f5b

Browse files
authored
Merge pull request #22 from HellPat/check-in-ci
starts testing
2 parents 9adda7f + 41f055c commit 4bb8f5b

5 files changed

Lines changed: 151 additions & 3 deletions

File tree

.github/workflows/main.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
merge_group:
6+
jobs:
7+
style:
8+
runs-on: ubuntu-latest
9+
defaults:
10+
run:
11+
shell: nix-shell --pure --run "bash -euxo pipefail {0}"
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: cachix/install-nix-action@v22
15+
- run: composer install --ignore-platform-req=ext-redis
16+
- run: vendor/bin/ecs
17+
- run: bin/console cache:warmup
18+
- run: bin/console lint:twig templates -n --format=github
19+
- run: composer validate composer.json --no-check-publish
20+
- run: symfony security:check
21+
# symfony security:check
22+
# vendor/bin/parallel-lint src public migrations config
23+
# composer validate composer.json --no-check-publish
24+
# XDEBUG_MODE=off bin/composer-require-checker --no-interaction --config-file=$PWD/composer-require-checker.json
25+
# vendor/bin/config-transformer --dry-run
26+
# bin/console lint:container -n
27+
# bin/console cache:warmup
28+
# bin/console lint:twig templates -n {{ if output == "github" { "--format=github" } else { "" } }}
29+
# bin/console lint:yaml . *.yaml --parse-tags -n {{ if output == "github" { "--format=github" } else { "" } }}
30+
# bin/console debug:translation --all --only-missing en
31+
# bin/console lint:xliff translations --no-interaction {{ if output == "github" { "--format=github" } else { "" } }}
32+
# vendor/bin/rector --dry-run
33+
# vendor/bin/php-cs-fixer fix --dry-run --diff
34+
# vendor/bin/psalm {{ if output == "github" { "--output-format=github" } else { "" } }}
35+
# vendor/bin/phpstan -v --memory-limit=1G {{ if output == "github" { "--error-format=github" } else { "" } }}
36+
# cd .. && pnpm spectral lint openapi.yaml {{ if output == "github" { "--format=github-actions" } else { "" } }}
37+
38+
psalm:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: cachix/install-nix-action@v22
43+
- shell: nix-shell --pure --run "bash -euxo pipefail {0}"
44+
run: |
45+
# TODO: cache composer dependencies
46+
# TODO: check why --ignore-platform-req=ext-redis is needed
47+
composer install --ignore-platform-req=ext-redis
48+
vendor/bin/psalm --output-format=github
49+
50+
phpunit:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: cachix/install-nix-action@v22
55+
# TODO: cache the build
56+
- shell: nix-shell --pure --run "bash -euxo pipefail {0}"
57+
run: |
58+
# TODO: cache composer dependencies
59+
# TODO: check why --ignore-platform-req=ext-redis is needed
60+
composer install --ignore-platform-req=ext-redis
61+
XDEBUG_MODE=coverage vendor/bin/phpunit --order-by=random --stop-on-error --stop-on-failure

Justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ lint:
3535
vendor/bin/ecs
3636

3737
fix:
38-
vendor/bin/ecs --fix
38+
vendor/bin/ecs --fix
39+
just --fmt --unstable

phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
backupGlobals="false"
77
colors="true"
88
bootstrap="tests/bootstrap.php"
9-
convertDeprecationsToExceptions="false"
9+
executionOrder="depends,defects"
1010
>
1111
<php>
1212
<ini name="display_errors" value="1" />
@@ -23,6 +23,8 @@
2323
</testsuite>
2424
</testsuites>
2525

26+
<!--
27+
TODO: fix phpunit config
2628
<coverage processUncoveredFiles="true">
2729
<include>
2830
<directory suffix=".php">src</directory>
@@ -32,6 +34,7 @@
3234
<listeners>
3335
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
3436
</listeners>
37+
-->
3538

3639
<extensions>
3740
</extensions>

psalm-baseline.xml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files
3+
psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4"
4+
php-version="
5+
php:8.3.2;
6+
apcu:5.1.23;
7+
bcmath:8.3.2;
8+
calendar:8.3.2;
9+
Core:8.3.2;
10+
ctype:8.3.2;
11+
curl:8.3.2;
12+
date:8.3.2;
13+
dom:20031129;
14+
exif:8.3.2;
15+
fileinfo:8.3.2;
16+
filter:8.3.2;
17+
ftp:8.3.2;
18+
gd:8.3.2;
19+
gettext:8.3.2;
20+
gmp:8.3.2;
21+
hash:8.3.2;
22+
iconv:8.3.2;
23+
imap:8.3.2;
24+
intl:8.3.2;
25+
json:8.3.2;
26+
ldap:8.3.2;
27+
libxml:8.3.2;
28+
mbstring:8.3.2;
29+
mysqli:8.3.2;
30+
mysqlnd:mysqlnd 8.3.2;
31+
openssl:8.3.2;
32+
pcntl:8.3.2;
33+
pcre:8.3.2;
34+
PDO:8.3.2;
35+
pdo_mysql:8.3.2;
36+
PDO_ODBC:8.3.2;
37+
pdo_pgsql:8.3.2;
38+
pdo_sqlite:8.3.2;
39+
pgsql:8.3.2;
40+
Phar:8.3.2;
41+
posix:8.3.2;
42+
random:8.3.2;
43+
readline:8.3.2;
44+
redis:6.0.2;
45+
Reflection:8.3.2;
46+
session:8.3.2;
47+
SimpleXML:8.3.2;
48+
soap:8.3.2;
49+
sockets:8.3.2;
50+
sodium:8.3.2;
51+
SPL:8.3.2;
52+
sqlite3:8.3.2;
53+
standard:8.3.2;
54+
sysvsem:8.3.2;
55+
tokenizer:8.3.2;
56+
xml:8.3.2;
57+
xmlreader:8.3.2;
58+
xmlwriter:8.3.2;
59+
Zend OPcache:8.3.2;
60+
Zend OPcache:8.3.2;
61+
zip:1.22.3;
62+
zlib:8.3.2
63+
"
64+
>
65+
<file src="src/Stripe/RemoteEventHandler.php">
66+
<MixedMethodCall>
67+
<code>__invoke</code>
68+
</MixedMethodCall>
69+
</file>
70+
<file src="src/Stripe/UpdateProduct.php">
71+
<RiskyTruthyFalsyComparison>
72+
<code><![CDATA[$product->default_price]]></code>
73+
</RiskyTruthyFalsyComparison>
74+
</file>
75+
<file src="src/Stripe/UpdateSubscription.php">
76+
<RiskyTruthyFalsyComparison>
77+
<code><![CDATA[$subscription->cancel_at]]></code>
78+
<code><![CDATA[$subscription->canceled_at]]></code>
79+
</RiskyTruthyFalsyComparison>
80+
</file>
81+
</files>

psalm.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
findUnusedCode="true"
1010
findUnusedPsalmSuppress="true"
1111
findUnusedVariablesAndParams="true"
12+
errorBaseline="psalm-baseline.xml"
13+
includePhpVersionsInErrorBaseline="true"
1214
>
1315
<fileExtensions>
1416
<extension name=".php" />
15-
<extension name=".twig" checker="./vendor/psalm/plugin-symfony/src/Twig/TemplateFileAnalyzer.php"/>
17+
<extension name=".twig" checker="/vendor/psalm/plugin-symfony/src/Twig/TemplateFileAnalyzer.php"/>
1618
</fileExtensions>
1719

1820
<projectFiles>

0 commit comments

Comments
 (0)