Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Replace phplint and streamline testing #220

Merged
merged 1 commit into from
Oct 11, 2024
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
26 changes: 15 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,27 @@ lint:yaml:
script:
- yamllint -c Build/yamllint.yaml Configuration/ Resources/

lint:php81:
.lint_php: &lint_php
stage: lint
image: php:8.1-alpine
image: $CONTAINER_IMAGE
script:
- find . -name \*.php -exec php -l "{}" \;
- find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

lint:php82:
lint:php81:
<<: *lint_php
stage: lint
image: php:8.2-alpine
script:
- find . -name \*.php -exec php -l "{}" \;
variables:
CONTAINER_IMAGE: php:8.1-alpine

lint:php82:
<<: *lint_php
variables:
CONTAINER_IMAGE: php:8.2-alpine

lint:php83:
stage: lint
image: php:8.3-alpine
script:
- find . -name \*.php -exec php -l "{}" \;
<<: *lint_php
variables:
CONTAINER_IMAGE: php:8.3-alpine

phpstan:analyse:
image: $CI_REGISTRY/containers/phpunit-with-php-8.1:main
Expand Down
7 changes: 0 additions & 7 deletions Build/phplint.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"codeception/module-webdriver": "^4.0",
"friendsofphp/php-cs-fixer": "^3.16",
"helmich/typo3-typoscript-lint": "^3.1",
"overtrue/phplint": "^5.5",
"phpstan/phpstan": "^1.10",
"ssch/typo3-rector": "^2.6",
"typo3/cms-dashboard": "^12.4",
Expand All @@ -77,7 +76,7 @@
"vendor/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./"
],
"test:php:lint": [
"vendor/bin/phplint -c Build/phplint.yaml"
"find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"
],
"test:php:unit": [
"vendor/bin/phpunit -c Build/UnitTests.xml"
Expand Down
26 changes: 26 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,30 @@ let
'';
};

projectLint = pkgs.writeShellApplication {
name = "project-lint";

runtimeInputs = [
php
];

text = ''
find ./*.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
'';
};

projectPhpstan = pkgs.writeShellApplication {
name = "project-phpstan";

runtimeInputs = [
php
];

text = ''
./vendor/bin/phpstan analyse -c Build/phpstan.neon --memory-limit 256M
'';
};

projectTestUnit = pkgs.writeShellApplication {
name = "project-test-unit";
runtimeInputs = [
Expand Down Expand Up @@ -110,6 +134,8 @@ in pkgs.mkShellNoCC {
projectInstall
projectCgl
projectCglFix
projectLint
projectPhpstan
projectTestUnit
projectTestFunctional
projectTestAcceptance
Expand Down
Loading