22 - build
33 - code quality
44 - dependency scanning
5+ - outdated packages
56 - test
67 - deploy
78
@@ -17,13 +18,12 @@ cache: &global_cache
1718
1819# Build section
1920Install dependencies and build assets :
20- image : sumocoders/cli-tools-php83 :latest
21+ image : sumocoders/cli-tools-php84 :latest
2122 script :
2223 - COMPOSER_MEMORY_LIMIT=-1 composer install --no-scripts --no-progress
2324 - COMPOSER_MEMORY_LIMIT=-1 composer run-script post-autoload-dump
24- - volta install node
25- - npm ci --no-progress
26- - node_modules/.bin/encore production
25+ - php bin/console importmap:install --no-interaction
26+ - php bin/console sass:build --no-interaction
2727 - php bin/console fos:js-routing:dump --format=json --locale=nl --target=public/build/routes/fos_js_routes.json
2828 cache :
2929 << : *global_cache
@@ -35,154 +35,162 @@ Install dependencies and build assets:
3535
3636# Code Quality section
3737PHP_CodeSniffer - check code styling :
38- image : sumocoders/cli-tools-php83 :latest
38+ image : sumocoders/cli-tools-php84 :latest
3939 script :
40- - vendor/bin/phpcs --report-full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-report.xml
40+ - php vendor/bin/phpcs --report-full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-report.json
4141 artifacts :
4242 expire_in : 1 week
4343 reports :
44- codequality : phpcs-report.xml
44+ codequality : phpcs-report.json
4545 stage : code quality
46- needs : ["Install dependencies and build assets"]
46+ needs : [ "Install dependencies and build assets" ]
4747 tags :
4848 - docker
4949
5050PHPStan - check for bugs :
51- image : sumocoders/cli-tools-php83 :latest
51+ image : sumocoders/cli-tools-php84 :latest
5252 before_script :
53- - bin/console cache:warmup --env=dev
53+ - php bin/console cache:warmup --env=dev
5454 script :
55- - vendor/bin/phpstan analyse --memory-limit=-1 --error-format=gitlab --no-progress --no-interaction > phpstan-report.xml
55+ - php vendor/bin/phpstan analyse --memory-limit=-1 --error-format=gitlab --no-progress --no-interaction > phpstan-report.json
5656 after_script :
5757 # Run it again so the output is visible in the job
5858 - >
5959 if [ $CI_JOB_STATUS != 'success' ]; then
60- vendor/bin/phpstan analyse --memory-limit=-1 --no-progress
60+ php vendor/bin/phpstan analyse --memory-limit=-1 --no-progress
6161 fi
6262 artifacts :
6363 expire_in : 1 week
6464 reports :
65- codequality : phpstan-report.xml
65+ codequality : phpstan-report.json
6666 stage : code quality
67- needs : ["Install dependencies and build assets"]
67+ needs : [ "Install dependencies and build assets" ]
6868 tags :
6969 - docker
7070
7171Twig-CS-Fixer - check code styling :
72- image : sumocoders/cli-tools-php83 :latest
72+ image : sumocoders/cli-tools-php84 :latest
7373 script :
74- - vendor/bin/twig-cs-fixer lint templates/ --report=junit > twigcs-report.xml
74+ - php vendor/bin/twig-cs-fixer lint templates/ --report=junit > twigcs-report.xml
7575 after_script :
7676 # Run it again so the output is visible in the job
77- - vendor/bin/twig-cs-fixer lint templates/
77+ - >
78+ if [ $CI_JOB_STATUS != 'success' ]; then
79+ php vendor/bin/twig-cs-fixer --no-interaction lint templates/
80+ fi
7881 artifacts :
7982 expire_in : 1 week
8083 reports :
8184 junit : twigcs-report.xml
8285 stage : code quality
83- needs : ["Install dependencies and build assets"]
86+ needs : [ "Install dependencies and build assets" ]
8487 tags :
8588 - docker
8689 allow_failure : true
8790
8891Stylelint - check code styling :
89- image : sumocoders/cli-tools-php83 :latest
92+ image : sumocoders/stylelint :latest
9093 script :
91- - node_modules/.bin/ stylelint --output-file=stylelint-report.json --custom-formatter=node_modules/ stylelint-formatter-gitlab-code-quality-report/index.js .
94+ - stylelint --output-file=stylelint-report.json --custom-formatter=stylelint-formatter-gitlab-code-quality-report .
9295 after_script :
93- # Run it again so the output is visible in the job
94- - node_modules/.bin/stylelint --color .
96+ - >
97+ if [ $CI_JOB_STATUS != 'success' ]; then
98+ stylelint --color .
99+ fi
95100 artifacts :
96101 expire_in : 1 week
97102 reports :
98103 codequality : stylelint-report.json
99104 stage : code quality
100- needs : ["Install dependencies and build assets"]
105+ needs : [ "Install dependencies and build assets" ]
101106 tags :
102107 - docker
103108 allow_failure : true
104109
105110StandardJS - check code styling :
106- image : sumocoders/cli-tools-php83 :latest
111+ image : sumocoders/standardjs :latest
107112 script :
108- - node_modules/.bin/ standard | node_modules/.bin/ standard-gitlab --output-file standardjs-report.json --human-readable
113+ - sh -c ' standard . | standard-gitlab --output-file standardjs-report.json --human-readable'
109114 artifacts :
110115 expire_in : 1 week
111116 reports :
112117 codequality : standardjs-report.json
113118 stage : code quality
114- needs : ["Install dependencies and build assets"]
119+ needs : [ "Install dependencies and build assets" ]
115120 tags :
116121 - docker
117122 allow_failure : true
118123
119124
120125# Dependency Scanning section
121126NPM packages - check for vulnerabilities :
122- image : sumocoders/cli-tools-php83 :latest
127+ image : sumocoders/cli-tools-php84 :latest
123128 script :
124- - npm audit --omit=dev --json | ./node_modules/.bin/gitlab-npm-audit-parser -o npm-audit-report.json
125- - npm audit --omit=dev
126- artifacts :
127- expire_in : 1 week
128- reports :
129- dependency_scanning : npm-audit-report.json
129+ - php bin/console importmap:audit --no-interaction --ansi
130130 stage : dependency scanning
131- needs : ["Install dependencies and build assets"]
131+ needs : [ "Install dependencies and build assets" ]
132132 tags :
133133 - docker
134134 allow_failure : true
135135
136- PHP packages - local-php-security-checker :
137- image : sumocoders/cli-tools-php83:latest
138- before_script :
139- - PHP_SC_VERSION=$(curl -s "https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/;s/^v//')
140- - curl -LSs https://github.com/fabpot/local-php-security-checker/releases/download/v${PHP_SC_VERSION}/local-php-security-checker_linux_amd64 > ./local-php-security-checker
141- - chmod +x ./local-php-security-checker
136+ PHP packages - composer audit :
137+ image : sumocoders/cli-tools-php84:latest
142138 script :
143- - ./local-php-security-checker --format=ansi
139+ - composer audit --ansi --no-interaction
144140 stage : dependency scanning
145- needs : ["Install dependencies and build assets"]
141+ needs : [ "Install dependencies and build assets" ]
146142 tags :
147143 - docker
148144 allow_failure : true
149145
150- PHP packages - composer audit :
151- image : sumocoders/cli-tools-php83:latest
146+
147+ # Outdated packages Scanning section
148+ NPM packages - check for outdated packages :
149+ image : sumocoders/cli-tools-php84:latest
152150 script :
153- - composer audit --ansi --no-interaction
154- stage : dependency scanning
155- needs : ["Install dependencies and build assets"]
151+ - php bin/console importmap:outdated --no-interaction --ansi
152+ stage : outdated packages
153+ needs : [ "Install dependencies and build assets" ]
154+ tags :
155+ - docker
156+ allow_failure : true
157+
158+ PHP packages - composer outdated :
159+ image : sumocoders/cli-tools-php84:latest
160+ script :
161+ - composer outdated --ansi --no-interaction
162+ stage : outdated packages
163+ needs : [ "Install dependencies and build assets" ]
156164 tags :
157165 - docker
158166 allow_failure : true
159167
160168
161169# Test section
162170PHPUnit - Run tests :
163- image : sumocoders/framework-php83 :latest
171+ image : sumocoders/framework-php84 :latest
164172 services :
165173 - mysql:5.7
166174 before_script :
167- # Uncomment this if you need Chrome for PDF's
168- # or if you have integration tests that use Symfony Panther (https://github.com/symfony/panther)
169- # # install Chromium
170- # - apt-get --allow-releaseinfo-change update && apt-get install -y chromium
171- # # install Chromium Chromedriver
172- # - |
173- # curl -s -f -L -o /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE_97`/chromedriver_linux64.zip
174- # unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
175+ # Uncomment this if you need Chrome for PDF's
176+ # or if you have integration tests that use Symfony Panther (https://github.com/symfony/panther)
177+ # # install Chromium
178+ # - apt-get --allow-releaseinfo-change update && apt-get install -y chromium
179+ # # install Chromium Chromedriver
180+ # - |
181+ # curl -s -f -L -o /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE_97`/chromedriver_linux64.zip
182+ # unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
175183 script :
176184 - php bin/console doctrine:migrations:migrate --env=test --no-interaction --allow-no-migration
177185 # Uncomment this if you have fixtures that need to be loaded
178186 # Make sure that you have installed doctrine/doctrine-fixtures-bundle
179187 # - php bin/console doctrine:fixtures:load --env=test
180- - php vendor/bin/simple- phpunit --log-junit phpunit-report.xml
188+ - php vendor/bin/phpunit --color --testdox --log-junit phpunit-report.xml
181189 artifacts :
182190 reports :
183191 junit : phpunit-report.xml
184192 stage : test
185- needs : ["Install dependencies and build assets"]
193+ needs : [ "Install dependencies and build assets" ]
186194 tags :
187195 - docker
188196 variables :
@@ -195,7 +203,7 @@ PHPUnit - Run tests:
195203
196204# Deploy section
197205Deploy - to staging :
198- image : sumocoders/cli-tools-php83 :latest
206+ image : sumocoders/cli-tools-php84 :latest
199207 before_script :
200208 # Add the private SSH key to the CI environment
201209 - ' which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
@@ -206,10 +214,10 @@ Deploy - to staging:
206214 - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
207215 - chmod 644 ~/.ssh/known_hosts
208216 script :
209- - vendor/bin/dep deploy stage=staging
217+ - php vendor/bin/dep deploy stage=staging
210218 environment :
211219 name : staging
212- url : https://$project.$client.php83 .sumocoders.eu
220+ url : https://$project.$client.php84 .sumocoders.eu
213221 only :
214222 - staging
215223 stage : deploy
0 commit comments