Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/278-asset-mapper' into 12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas De Keukelaere committed Oct 23, 2024
2 parents bc66157 + 12476e6 commit c0d11bc
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 46 deletions.
132 changes: 91 additions & 41 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ stages:
- build
- code quality
- dependency scanning
- outdated packages
- test
- deploy

Expand All @@ -21,8 +22,8 @@ Install dependencies and build assets:
script:
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-scripts --no-progress
- COMPOSER_MEMORY_LIMIT=-1 composer run-script post-autoload-dump
- php bin/console sass:build --quiet
- php bin/console importmap:install --quiet
- php bin/console importmap:install --no-interaction
- php bin/console sass:build --no-interaction
- php bin/console fos:js-routing:dump --format=json --locale=nl --target=public/build/routes/fos_js_routes.json
cache:
<<: *global_cache
Expand All @@ -36,13 +37,13 @@ Install dependencies and build assets:
PHP_CodeSniffer - check code styling:
image: sumocoders/cli-tools-php83:latest
script:
- vendor/bin/phpcs --report-full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-report.xml
- vendor/bin/phpcs --report-full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-report.json
artifacts:
expire_in: 1 week
reports:
codequality: phpcs-report.xml
codequality: phpcs-report.json
stage: code quality
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker

Expand All @@ -51,7 +52,7 @@ PHPStan - check for bugs:
before_script:
- bin/console cache:warmup --env=dev
script:
- vendor/bin/phpstan analyse --memory-limit=-1 --error-format=gitlab --no-progress --no-interaction > phpstan-report.xml
- vendor/bin/phpstan analyse --memory-limit=-1 --error-format=gitlab --no-progress --no-interaction > phpstan-report.json
after_script:
# Run it again so the output is visible in the job
- >
Expand All @@ -61,9 +62,9 @@ PHPStan - check for bugs:
artifacts:
expire_in: 1 week
reports:
codequality: phpstan-report.xml
codequality: phpstan-report.json
stage: code quality
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker

Expand All @@ -73,47 +74,96 @@ Twig-CS-Fixer - check code styling:
- vendor/bin/twig-cs-fixer lint templates/ --report=junit > twigcs-report.xml
after_script:
# Run it again so the output is visible in the job
- vendor/bin/twig-cs-fixer lint templates/
- >
if [ $CI_JOB_STATUS != 'success' ]; then
vendor/bin/twig-cs-fixer --no-interaction lint templates/
fi
artifacts:
expire_in: 1 week
reports:
junit: twigcs-report.xml
stage: code quality
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

Stylelint - check code styling:
image: sumocoders/stylelint:latest
script:
- stylelint --output-file=stylelint-report.json --custom-formatter=stylelint-formatter-gitlab-code-quality-report .
after_script:
- >
if [ $CI_JOB_STATUS != 'success' ]; then
stylelint --color .
fi
artifacts:
expire_in: 1 week
reports:
codequality: stylelint-report.json
stage: code quality
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

StandardJS - check code styling:
image: sumocoders/standardjs:latest
script:
- sh -c 'standard . | standard-gitlab --output-file standardjs-report.json --human-readable'
artifacts:
expire_in: 1 week
reports:
codequality: standardjs-report.json
stage: code quality
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

#Stylelint - check code styling:
# image: sumocoders/cli-tools-php83:latest
# script:
# - node_modules/.bin/stylelint --output-file=stylelint-report.json --custom-formatter=node_modules/stylelint-formatter-gitlab-code-quality-report/index.js .
# after_script:
# # Run it again so the output is visible in the job
# - node_modules/.bin/stylelint --color .
# artifacts:
# expire_in: 1 week
# reports:
# codequality: stylelint-report.json
# stage: code quality
# needs: ["Install dependencies and build assets"]
# tags:
# - docker
# allow_failure: true

#StandardJS - check code styling:
# image: sumocoders/cli-tools-php83:latest
# script:
# - node_modules/.bin/standard | node_modules/.bin/standard-gitlab --output-file standardjs-report.json --human-readable
# artifacts:
# expire_in: 1 week
# reports:
# codequality: standardjs-report.json
# stage: code quality
# needs: ["Install dependencies and build assets"]
# tags:
# - docker
# allow_failure: true

# Dependency Scanning section
NPM packages - check for vulnerabilities:
image: sumocoders/cli-tools-php83:latest
script:
- php bin/console importmap:audit --no-interaction --ansi
stage: dependency scanning
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

PHP packages - composer audit:
image: sumocoders/cli-tools-php83:latest
script:
- composer audit --ansi --no-interaction
stage: dependency scanning
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true


# Outdated packages Scanning section
NPM packages - check for outdated packages:
image: sumocoders/cli-tools-php83:latest
script:
- php bin/console importmap:outdated --no-interaction --ansi
stage: outdated packages
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

PHP packages - composer outdated:
image: sumocoders/cli-tools-php83:latest
script:
- composer outdated --ansi --no-interaction
stage: outdated packages
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true


# Test section
Expand All @@ -140,7 +190,7 @@ PHPUnit - Run tests:
reports:
junit: phpunit-report.xml
stage: test
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker
variables:
Expand Down
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
assets/images/
assets/vendor/
bin/*
config/*
drivers/*
Expand Down
5 changes: 0 additions & 5 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ services:
errorFormatter.junit:
class: PHPStan\Command\ErrorFormatter\JUnitErrorFormatter
parameters:
checkGenericClassInNonGenericObjectType: false
inferPrivatePropertyTypeFromConstructor: true
symfony:
container_xml_path: %rootDir%/../../../var/cache/dev/App_KernelDevDebugContainer.xml
Expand All @@ -16,7 +15,3 @@ parameters:
excludePaths:
- %rootDir%/../../../src/Migrations
ignoreErrors:
- '#array of function array_map expects array, iterable<.*>#'
-
message: '#Property .*\$id is never written, only read.#'
path: src/Entity

0 comments on commit c0d11bc

Please sign in to comment.