From b1a61e2717f77bb30624a6dd9b8ecbdc6e355121 Mon Sep 17 00:00:00 2001 From: Patrick Heller Date: Tue, 23 Jan 2024 21:43:24 +0100 Subject: [PATCH 1/3] starts testing --- .github/workflows/main.yaml | 13 +++++++++++++ psalm.xml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..89d3b57 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,13 @@ +name: Tests + +on: + push: + +jobs: + psalm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v22 + # TODO: check why --ignore-platform-req=ext-redis is needed + - run: nix-shell --pure --run "composer install --ignore-platform-req=ext-redis && vendor/bin/psalm --output-format=github" \ No newline at end of file diff --git a/psalm.xml b/psalm.xml index 30527ee..04c1308 100644 --- a/psalm.xml +++ b/psalm.xml @@ -12,7 +12,7 @@ > - + From ed057544d2502f930967f2ca50b54c113fca9cb1 Mon Sep 17 00:00:00 2001 From: Patrick Heller Date: Tue, 23 Jan 2024 22:11:23 +0100 Subject: [PATCH 2/3] starts with ci testing --- .github/workflows/main.yaml | 30 +++++++++++++- Justfile | 3 +- phpunit.xml.dist | 5 ++- psalm-baseline.xml | 81 +++++++++++++++++++++++++++++++++++++ psalm.xml | 2 + 5 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 psalm-baseline.xml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 89d3b57..a82ff82 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,12 +2,38 @@ 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 + psalm: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v22 # TODO: check why --ignore-platform-req=ext-redis is needed - - run: nix-shell --pure --run "composer install --ignore-platform-req=ext-redis && vendor/bin/psalm --output-format=github" \ No newline at end of file + - shell: nix-shell --pure --run "bash -euxo pipefail {0}" + run: | + 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: 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 diff --git a/Justfile b/Justfile index da7585d..2cde53e 100644 --- a/Justfile +++ b/Justfile @@ -35,4 +35,5 @@ lint: vendor/bin/ecs fix: - vendor/bin/ecs --fix \ No newline at end of file + vendor/bin/ecs --fix + just --fmt --unstable \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6c4bfed..2f666e4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,7 +6,7 @@ backupGlobals="false" colors="true" bootstrap="tests/bootstrap.php" - convertDeprecationsToExceptions="false" + executionOrder="depends,defects" > @@ -23,6 +23,8 @@ + diff --git a/psalm-baseline.xml b/psalm-baseline.xml new file mode 100644 index 0000000..02d6f11 --- /dev/null +++ b/psalm-baseline.xml @@ -0,0 +1,81 @@ + + + + + __invoke + + + + + default_price]]> + + + + + cancel_at]]> + canceled_at]]> + + + diff --git a/psalm.xml b/psalm.xml index 04c1308..265d9c8 100644 --- a/psalm.xml +++ b/psalm.xml @@ -9,6 +9,8 @@ findUnusedCode="true" findUnusedPsalmSuppress="true" findUnusedVariablesAndParams="true" + errorBaseline="psalm-baseline.xml" + includePhpVersionsInErrorBaseline="true" > From 41f055c2908ff4742a14e67697145269b981d8f0 Mon Sep 17 00:00:00 2001 From: Patrick Heller Date: Tue, 23 Jan 2024 22:47:31 +0100 Subject: [PATCH 3/3] multi step --- .github/workflows/main.yaml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a82ff82..db31fe4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,15 +14,36 @@ jobs: - 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 - # TODO: check why --ignore-platform-req=ext-redis is needed - 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 @@ -34,6 +55,7 @@ jobs: # 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