Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3424701
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3424701
Commits
81d8971a
Verified
Commit
81d8971a
authored
8 months ago
by
Théodore Biadala
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3463479
by catch, Spokje, larowlan: Merge the build and lint stages in core MR pipelines
parent
f82e35fb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+36
-60
36 additions, 60 deletions
.gitlab-ci.yml
.gitlab-ci/pipeline.yml
+5
-4
5 additions, 4 deletions
.gitlab-ci/pipeline.yml
with
41 additions
and
64 deletions
.gitlab-ci.yml
+
36
−
60
View file @
81d8971a
...
@@ -69,7 +69,6 @@ variables:
...
@@ -69,7 +69,6 @@ variables:
# Stages #
# Stages #
#############
#############
stages
:
stages
:
-
🏗️ Build
-
🪄 Lint
-
🪄 Lint
-
🗜️ Test
-
🗜️ Test
...
@@ -96,11 +95,7 @@ default:
...
@@ -96,11 +95,7 @@ default:
.with-composer
:
&with-composer
.with-composer
:
&with-composer
needs
:
needs
:
-
'
📦️
Composer'
-
'
🧹
PHP
Coding
standards
(PHPCS)'
.with-yarn
:
&with-yarn
needs
:
-
'
📦️
Yarn'
.default-job-settings-lint
:
&default-job-settings-lint
.default-job-settings-lint
:
&default-job-settings-lint
rules
:
rules
:
...
@@ -240,65 +235,22 @@ default:
...
@@ -240,65 +235,22 @@ default:
needs
:
[
'
[Daily]
PHP
8.3
SQLite
3.45'
]
needs
:
[
'
[Daily]
PHP
8.3
SQLite
3.45'
]
<<
:
[
*run-daily
]
<<
:
[
*run-daily
]
################
# Build Jobs for linting
################
'
📦️
Composer'
:
variables
:
KUBERNETES_CPU_REQUEST
:
"
1"
stage
:
🏗️ Build
cache
:
key
:
files
:
-
./composer.json
-
./composer.lock
paths
:
-
./vendor
artifacts
:
expire_in
:
1 week
expose_as
:
'
web-vendor'
paths
:
-
vendor/
script
:
-
composer validate
-
composer install --optimize-autoloader
-
if [ -n "$COMPOSER_UPDATE" ]; then
composer update --optimize-autoloader;
composer outdated;
fi
'
📦️
Yarn'
:
variables
:
KUBERNETES_CPU_REQUEST
:
"
2"
stage
:
🏗️ Build
cache
:
key
:
files
:
-
./core/package.json
-
./core/yarn.lock
paths
:
-
./core/node_modules
artifacts
:
expire_in
:
1 week
expose_as
:
'
yarn-vendor'
paths
:
-
core/node_modules/
script
:
-
cd core
-
corepack enable
-
yarn install
################
################
# Lint Jobs
# Lint Jobs
################
################
'
🧹
PHP
Static
Analysis
(phpstan)'
:
'
🧹
PHP
Static
Analysis
(phpstan)'
:
<<
:
[
*with-composer
,
*default-job-settings-lint
]
<<
:
[
*default-job-settings-lint
]
stage
:
🪄 Lint
stage
:
🪄 Lint
variables
:
variables
:
KUBERNETES_CPU_REQUEST
:
"
16"
KUBERNETES_CPU_REQUEST
:
"
16"
script
:
script
:
-
composer validate
-
composer install --optimize-autoloader
-
if [ -n "$COMPOSER_UPDATE" ]; then
composer update --optimize-autoloader;
composer outdated;
fi
-
vendor/bin/phpstan --version
-
vendor/bin/phpstan --version
# Rely on PHPStan caching to execute analysis multiple times without performance drawback.
# Rely on PHPStan caching to execute analysis multiple times without performance drawback.
# Output a copy in junit.
# Output a copy in junit.
...
@@ -324,19 +276,28 @@ default:
...
@@ -324,19 +276,28 @@ default:
-
core/.phpstan-baseline.php
-
core/.phpstan-baseline.php
'
🧹
PHP
Coding
standards
(PHPCS)'
:
'
🧹
PHP
Coding
standards
(PHPCS)'
:
<<
:
[
*with-composer
,
*default-job-settings-lint
]
<<
:
[
*default-job-settings-lint
]
stage
:
🪄 Lint
stage
:
🪄 Lint
variables
:
variables
:
KUBERNETES_CPU_REQUEST
:
"
16"
KUBERNETES_CPU_REQUEST
:
"
16"
script
:
script
:
-
composer validate
-
composer install --optimize-autoloader
-
if [ -n "$COMPOSER_UPDATE" ]; then
composer update --optimize-autoloader;
composer outdated;
fi
-
vendor/bin/phpcs --version
-
vendor/bin/phpcs --version
-
composer phpcs -- -s --report-full --report-summary --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json
-
composer phpcs -- -s --report-full --report-summary --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json
artifacts
:
artifacts
:
expire_in
:
1 week
expose_as
:
'
web-vendor'
paths
:
-
vendor/
reports
:
reports
:
codequality
:
phpcs-quality-report.json
codequality
:
phpcs-quality-report.json
'
🧹
JavaScript
linting
(eslint)'
:
'
🧹
JavaScript
linting
(eslint)'
:
<<
:
[
*with-yarn
]
stage
:
🪄 Lint
stage
:
🪄 Lint
variables
:
variables
:
KUBERNETES_CPU_REQUEST
:
"
2"
KUBERNETES_CPU_REQUEST
:
"
2"
...
@@ -356,6 +317,7 @@ default:
...
@@ -356,6 +317,7 @@ default:
script
:
script
:
-
cd core
-
cd core
-
corepack enable
-
corepack enable
-
yarn install
-
yarn run check:ckeditor5
-
yarn run check:ckeditor5
-
yarn run lint:core-js-passing --format gitlab
-
yarn run lint:core-js-passing --format gitlab
artifacts
:
artifacts
:
...
@@ -363,7 +325,6 @@ default:
...
@@ -363,7 +325,6 @@ default:
codequality
:
eslint-quality-report.json
codequality
:
eslint-quality-report.json
'
🧹
CSS
linting
(stylelint)'
:
'
🧹
CSS
linting
(stylelint)'
:
<<
:
[
*with-yarn
]
stage
:
🪄 Lint
stage
:
🪄 Lint
variables
:
variables
:
KUBERNETES_CPU_REQUEST
:
"
2"
KUBERNETES_CPU_REQUEST
:
"
2"
...
@@ -382,6 +343,7 @@ default:
...
@@ -382,6 +343,7 @@ default:
script
:
script
:
-
corepack enable
-
corepack enable
-
cd core
-
cd core
-
yarn install
-
yarn run build:css --check
-
yarn run build:css --check
-
yarn run lint:css --color --custom-formatter=node_modules/stylelint-formatter-gitlab
-
yarn run lint:css --color --custom-formatter=node_modules/stylelint-formatter-gitlab
artifacts
:
artifacts
:
...
@@ -389,7 +351,7 @@ default:
...
@@ -389,7 +351,7 @@ default:
codequality
:
stylelint-quality-report.json
codequality
:
stylelint-quality-report.json
'
📔
Spell-checking'
:
'
📔
Spell-checking'
:
<<
:
[
*with-yarn
,
*default-job-settings-lint
]
<<
:
[
*default-job-settings-lint
]
stage
:
🪄 Lint
stage
:
🪄 Lint
variables
:
variables
:
KUBERNETES_CPU_REQUEST
:
"
2"
KUBERNETES_CPU_REQUEST
:
"
2"
...
@@ -401,8 +363,21 @@ default:
...
@@ -401,8 +363,21 @@ default:
fi;
fi;
-
cd core
-
cd core
-
corepack enable
-
corepack enable
-
yarn install
-
git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only 2>1 > /dev/null || (echo "Warning, cannot find changed files, converting to full clone." & (git fetch --unshallow --quiet && echo "Fetch successful."))
-
git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only 2>1 > /dev/null || (echo "Warning, cannot find changed files, converting to full clone." & (git fetch --unshallow --quiet && echo "Fetch successful."))
-
git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only | sed "s_^_../_" | yarn run spellcheck:core --no-must-find-files --file-list stdin
-
git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only | sed "s_^_../_" | yarn run spellcheck:core --no-must-find-files --file-list stdin
cache
:
key
:
files
:
-
./core/package.json
-
./core/yarn.lock
paths
:
-
./core/node_modules
artifacts
:
expire_in
:
1 week
expose_as
:
'
yarn-vendor'
paths
:
-
core/node_modules/
'
📔
Validatable
config'
:
'
📔
Validatable
config'
:
<<
:
[
*default-job-settings-lint
]
<<
:
[
*default-job-settings-lint
]
...
@@ -412,6 +387,7 @@ default:
...
@@ -412,6 +387,7 @@ default:
_TARGET_PHP
:
"
8.3-ubuntu"
_TARGET_PHP
:
"
8.3-ubuntu"
# Run on MRs if config schema files have changed, or manually.
# Run on MRs if config schema files have changed, or manually.
rules
:
rules
:
-
if
:
$PERFORMANCE_TEST != "1"
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
changes
:
changes
:
-
"
**/config/schema/*.schema.yml"
-
"
**/config/schema/*.schema.yml"
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci/pipeline.yml
+
5
−
4
View file @
81d8971a
...
@@ -47,14 +47,14 @@ default:
...
@@ -47,14 +47,14 @@ default:
.with-composer
:
&with-composer
.with-composer
:
&with-composer
needs
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
'
📦️
Composer
'
job
:
'
🧹
PHP
Coding
standards
(PHPCS)
'
.with-composer-and-yarn
:
&with-composer-and-yarn
.with-composer-and-yarn
:
&with-composer-and-yarn
needs
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
'
📦️
Composer
'
job
:
'
🧹
PHP
Coding
standards
(PHPCS)
'
-
pipeline
:
$PARENT_PIPELINE_ID
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
'
📦️
Yarn
'
job
:
'
📔
Spell-checking
'
variables
:
variables
:
FF_NETWORK_PER_BUILD
:
1
FF_NETWORK_PER_BUILD
:
1
...
@@ -280,7 +280,7 @@ variables:
...
@@ -280,7 +280,7 @@ variables:
-
<<
:
*with-database
-
<<
:
*with-database
'
🚲
Performance
tests'
:
'
🚲
Performance
tests'
:
<<
:
[
*with-composer
,
*default-job-settings
]
<<
:
[
*default-job-settings
]
rules
:
rules
:
-
if
:
$PERFORMANCE_TEST == "1"
-
if
:
$PERFORMANCE_TEST == "1"
-
when
:
manual
-
when
:
manual
...
@@ -300,6 +300,7 @@ variables:
...
@@ -300,6 +300,7 @@ variables:
[[ $_TARGET_DB == mysql* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == mysql* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == mariadb* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == mariadb* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == pgsql* ]] && export SIMPLETEST_DB=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB?module=pgsql
[[ $_TARGET_DB == pgsql* ]] && export SIMPLETEST_DB=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB?module=pgsql
-
composer install --optimize-autoloader
-
export OTEL_COLLECTOR="$OTEL_COLLECTOR"
-
export OTEL_COLLECTOR="$OTEL_COLLECTOR"
-
mkdir -p ./sites/simpletest ./sites/default/files ./build/logs/junit /var/www/.composer
-
mkdir -p ./sites/simpletest ./sites/default/files ./build/logs/junit /var/www/.composer
-
chown -R www-data:www-data ./sites ./build/logs/junit ./vendor /var/www/
-
chown -R www-data:www-data ./sites ./build/logs/junit ./vendor /var/www/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment