Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3421017
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-3421017
Commits
1bdbe868
Commit
1bdbe868
authored
1 year ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3387503
by bbrala: Move Gitlab linting steps to main job
parent
6950cac3
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
+153
-1
153 additions, 1 deletion
.gitlab-ci.yml
.gitlab-ci/pipeline.yml
+14
-79
14 additions, 79 deletions
.gitlab-ci/pipeline.yml
with
167 additions
and
80 deletions
.gitlab-ci.yml
+
153
−
1
View file @
1bdbe868
# cspell:ignore drupaltestbot drupaltestbotpw codequality Micheh micheh
################
# Drupal GitLabCI template.
#
...
...
@@ -46,6 +48,77 @@ variables:
CONCURRENCY
:
32
GIT_DEPTH
:
"
3"
#############
# Stages #
#############
stages
:
-
🏗️ Build
-
🪄 Lint
-
🗜️ Test
#############
# Templates #
#############
.default-job-settings
:
&default-job-settings-lint
allow_failure
:
false
variables
:
_TARGET_PHP
:
"
8.2"
_TARGET_DB
:
"
mysql-8"
image
:
name
:
$_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
.composer-cache
:
&composer-cache
key
:
files
:
-
./composer.json
-
./composer.lock
paths
:
-
./vendor
.yarn-cache
:
&yarn-cache
key
:
files
:
-
./core/package.json
-
./core/yarn.lock
paths
:
-
./core/node_modules
.pull-composer-cache
:
&pull-composer-cache
cache
:
policy
:
pull
<<
:
*composer-cache
dependencies
:
-
'
📦️
Composer'
.with-composer-cache
:
&with-composer-cache
needs
:
-
'
📦️
Composer'
<<
:
*pull-composer-cache
.with-yarn-cache
:
&with-yarn-cache
dependencies
:
-
'
📦️
Yarn'
needs
:
-
'
📦️
Yarn'
cache
:
policy
:
pull
<<
:
*yarn-cache
.junit-artifacts
:
&junit-artifacts
artifacts
:
expose_as
:
junit
expire_in
:
6 mos
paths
:
-
junit.xml
reports
:
junit
:
junit.xml
################
# Stages
#
...
...
@@ -57,7 +130,7 @@ variables:
################
.default-stage
:
&default-stage
stage
:
t
est
stage
:
🗜️ T
est
trigger
:
# Rely on the status of the child pipeline.
strategy
:
depend
...
...
@@ -131,3 +204,82 @@ variables:
# variables:
# _TARGET_PHP: "8.1"
# _TARGET_DB: "php-$_TARGET_PHP-apache"
################
# Build Jobs for linting
################
'
📦️
Composer'
:
<<
:
*default-job-settings-lint
stage
:
🏗️ Build
cache
:
<<
:
*composer-cache
artifacts
:
expire_in
:
1 week
expose_as
:
'
web-vendor'
paths
:
-
vendor/
script
:
-
export
-
composer validate
-
composer install
'
📦️
Yarn'
:
<<
:
*default-job-settings-lint
stage
:
🏗️ Build
cache
:
<<
:
*yarn-cache
artifacts
:
expire_in
:
1 week
expose_as
:
'
yarn-vendor'
paths
:
-
core/node_modules/
script
:
# Installs all core javascript dependencies and adds junit formatter.
-
yarn --cwd ./core add stylelint-junit-formatter
################
# Lint Jobs
################
'
🧹
PHP
Coding
standards
(PHPCS)'
:
<<
:
[
*with-composer-cache
,
*junit-artifacts
,
*default-job-settings-lint
]
stage
:
🪄 Lint
script
:
-
composer phpcs -- --report-junit=junit.xml --report-full --report-summary
'
🧹
PHP
Static
Analysis
(phpstan)'
:
<<
:
[
*with-composer-cache
,
*junit-artifacts
,
*default-job-settings-lint
]
stage
:
🪄 Lint
script
:
# Turn off apc to avoid corrupt composer cache.
-
php -d apc.enabled=0 -d apc.enable_cli=0 vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --error-format=junit > junit.xml
'
🧹
CSS
linting
(stylelint)'
:
<<
:
[
*with-yarn-cache
,
*junit-artifacts
,
*default-job-settings-lint
]
stage
:
🪄 Lint
script
:
-
yarn run --cwd=./core lint:css --color --custom-formatter node_modules/stylelint-junit-formatter > junit.xml
'
🧹
Compilation
check'
:
<<
:
[
*with-yarn-cache
,
*default-job-settings-lint
]
stage
:
🪄 Lint
script
:
-
yarn run --cwd=./core build:css --check
-
cd core && yarn run -s check:ckeditor5
'
🧹
JavaScript
linting
(eslint)'
:
<<
:
[
*with-yarn-cache
,
*junit-artifacts
,
*default-job-settings-lint
]
stage
:
🪄 Lint
script
:
-
yarn --cwd=./core run -s lint:core-js-passing --format junit > junit.xml
'
📔
Spell-checking'
:
<<
:
[
*with-yarn-cache
,
*default-job-settings-lint
]
stage
:
🪄 Lint
script
:
-
export TARGET_BRANCH=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}
-
git fetch -vn --depth=$GIT_DEPTH "${CI_MERGE_REQUEST_PROJECT_URL:-origin}" "+refs/heads/$TARGET_BRANCH:refs/heads/$TARGET_BRANCH"
-
export MODIFIED=`git diff --name-only refs/heads/$TARGET_BRANCH|while read r;do echo "$CI_PROJECT_DIR/$r";done|tr "\n" " "`
-
echo $MODIFIED | tr ' ' '\n' | yarn --cwd=./core run -s spellcheck:core --no-must-find-files --file-list stdin
This diff is collapsed.
Click to expand it.
.gitlab-ci/pipeline.yml
+
14
−
79
View file @
1bdbe868
...
...
@@ -8,13 +8,6 @@ stages:
################
-
🏗️ Build
################
# Code quality checks
#
# This stage includes any codebase validation before running tests.
################
-
🪄 Lint
################
# Test
#
...
...
@@ -81,18 +74,6 @@ stages:
reports
:
junit
:
junit.xml
.with-linting
:
&with-linting
needs
:
-
'
📦️
Composer'
-
'
🧹
PHP
Static
Analysis
(phpstan)'
-
'
🧹
PHP
Coding
standards
(PHPCS)'
-
'
🧹
Compilation
check'
-
'
📦️
Yarn'
-
'
📔
Spell-checking'
-
'
🧹
JavaScript
linting
(eslint)'
-
'
🧹
CSS
linting
(stylelint)'
<<
:
*pull-composer-cache
.with-unit-tests
:
&with-unit-tests
needs
:
-
'
⚡️
PHPUnit
Unit'
...
...
@@ -210,51 +191,6 @@ stages:
# Installs all core javascript dependencies and adds junit formatter.
-
yarn --cwd ./core add stylelint-junit-formatter
################
# Lint Jobs
################
'
🧹
PHP
Coding
standards
(PHPCS)'
:
<<
:
[
*with-composer-cache
,
*junit-artifacts
,
*default-job-settings
]
stage
:
🪄 Lint
script
:
-
composer phpcs -- --report-junit=junit.xml --report-full --report-summary
'
🧹
PHP
Static
Analysis
(phpstan)'
:
<<
:
[
*with-composer-cache
,
*junit-artifacts
,
*default-job-settings
]
stage
:
🪄 Lint
script
:
# Turn off apc to avoid corrupt composer cache.
-
php -d apc.enabled=0 -d apc.enable_cli=0 vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --error-format=junit > junit.xml
'
🧹
CSS
linting
(stylelint)'
:
<<
:
[
*with-yarn-cache
,
*junit-artifacts
,
*default-job-settings
]
stage
:
🪄 Lint
script
:
-
yarn run --cwd=./core lint:css --color --custom-formatter node_modules/stylelint-junit-formatter > junit.xml
'
🧹
Compilation
check'
:
<<
:
[
*with-yarn-cache
,
*default-job-settings
]
stage
:
🪄 Lint
script
:
-
yarn run --cwd=./core build:css --check
-
cd core && yarn run -s check:ckeditor5
'
🧹
JavaScript
linting
(eslint)'
:
<<
:
[
*with-yarn-cache
,
*junit-artifacts
,
*default-job-settings
]
stage
:
🪄 Lint
script
:
-
yarn --cwd=./core run -s lint:core-js-passing --format junit > junit.xml
'
📔
Spell-checking'
:
<<
:
[
*with-yarn-cache
,
*default-job-settings
]
stage
:
🪄 Lint
script
:
-
export TARGET_BRANCH=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}
-
git fetch -vn --depth=$GIT_DEPTH "${CI_MERGE_REQUEST_PROJECT_URL:-origin}" "+refs/heads/$TARGET_BRANCH:refs/heads/$TARGET_BRANCH"
-
export MODIFIED=`git diff --name-only refs/heads/$TARGET_BRANCH|while read r;do echo "$CI_PROJECT_DIR/$r";done|tr "\n" " "`
-
echo $MODIFIED | tr ' ' '\n' | yarn --cwd=./core run -s spellcheck:core --no-must-find-files --file-list stdin
################
# Test Jobs
################
...
...
@@ -271,10 +207,20 @@ stages:
TESTSUITE
:
PHPUnit-Unit
CONCURRENCY
:
"
$CONCURRENCY"
'
🌐️️
PHPUnit
Functional'
:
<<
:
[
*with-unit-tests
,
*phpunit-artifacts
,
*setup-webserver
,
*run-tests
,
*default-job-settings
]
stage
:
🗜️ Test
parallel
:
6
variables
:
<<
:
*test-variables
TESTSUITE
:
PHPUnit-Functional
CONCURRENCY
:
"
$CONCURRENCY"
services
:
-
<<
:
*with-database
'
⚙️️
PHPUnit
Kernel'
:
<<
:
[
*with-
composer-cache
,
*phpunit-artifacts
,
*setup-webserver
,
*run-tests
,
*default-job-settings
]
<<
:
[
*with-
unit-tests
,
*phpunit-artifacts
,
*setup-webserver
,
*run-tests
,
*default-job-settings
]
stage
:
🗜️ Test
parallel
:
3
variables
:
<<
:
*test-variables
TESTSUITE
:
PHPUnit-Kernel
...
...
@@ -283,7 +229,7 @@ stages:
-
<<
:
*with-database
'
🖱️️️
PHPUnit
Functional
Javascript'
:
<<
:
[
*with-linting
,
*with-unit-tests
,
*phpunit-artifacts
,
*setup-webserver
,
*run-tests
,
*default-job-settings
]
<<
:
[
*with-unit-tests
,
*phpunit-artifacts
,
*setup-webserver
,
*run-tests
,
*default-job-settings
]
stage
:
🗜️ Test
variables
:
<<
:
*test-variables
...
...
@@ -294,7 +240,7 @@ stages:
-
<<
:
*with-chrome
'
👷️️️
PHPUnit
Build'
:
<<
:
[
*with-linting
,
*with-unit-tests
,
*phpunit-artifacts
,
*setup-webserver
,
*run-tests
,
*default-job-settings
]
<<
:
[
*with-unit-tests
,
*phpunit-artifacts
,
*setup-webserver
,
*run-tests
,
*default-job-settings
]
stage
:
🗜️ Test
variables
:
<<
:
*test-variables
...
...
@@ -303,17 +249,6 @@ stages:
services
:
-
<<
:
*with-database
'
🌐️️
PHPUnit
Functional'
:
<<
:
[
*with-linting
,
*with-unit-tests
,
*phpunit-artifacts
,
*setup-webserver
,
*run-tests
,
*default-job-settings
]
stage
:
🗜️ Test
parallel
:
8
variables
:
<<
:
*test-variables
TESTSUITE
:
PHPUnit-Functional
CONCURRENCY
:
"
$CONCURRENCY"
services
:
-
<<
:
*with-database
'
🦉️️️
Nightwatch'
:
<<
:
[
*with-composer-yarn-and-unit-tests
,
*setup-webserver
,
*default-job-settings
]
stage
:
🗜️ Test
...
...
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