diff --git a/.gitlab/pipeline/.gitlab-ci.yml b/.gitlab/pipeline/.gitlab-ci.yml index cc1acbb..f2a57a8 100644 --- a/.gitlab/pipeline/.gitlab-ci.yml +++ b/.gitlab/pipeline/.gitlab-ci.yml @@ -7,310 +7,33 @@ stages: - test include: + - '/.gitlab/pipeline/jobs/.default.yml' + - '/.gitlab/pipeline/jobs/.default-frontend.yml' + - '/.gitlab/pipeline/jobs/.variables.yml' + - '/.gitlab/pipeline/jobs/build-composer-dependencies.yml' + - '/.gitlab/pipeline/jobs/composer-normalize.yml' + - '/.gitlab/pipeline/jobs/func-php7.2-v9.yml' + - '/.gitlab/pipeline/jobs/func-php7.2-v10.yml' + - '/.gitlab/pipeline/jobs/func-php7.3-v9.yml' + - '/.gitlab/pipeline/jobs/func-php7.3-v10.yml' + - '/.gitlab/pipeline/jobs/func-php7.4-v9.yml' + - '/.gitlab/pipeline/jobs/func-php7.4-v10.yml' + - '/.gitlab/pipeline/jobs/javascript-lint.yml' + - '/.gitlab/pipeline/jobs/json-lint.yml' + - '/.gitlab/pipeline/jobs/php-copypaste-check.yml' + - '/.gitlab/pipeline/jobs/php-lint-php7.2.yml' + - '/.gitlab/pipeline/jobs/php-lint-php7.3.yml' + - '/.gitlab/pipeline/jobs/php-lint-php7.4.yml' + - '/.gitlab/pipeline/jobs/phpcs.yml' + - '/.gitlab/pipeline/jobs/ts-lint.yml' + - '/.gitlab/pipeline/jobs/unit-php7.2-v9.yml' + - '/.gitlab/pipeline/jobs/unit-php7.2-v10.yml' + - '/.gitlab/pipeline/jobs/unit-php7.3-v9.yml' + - '/.gitlab/pipeline/jobs/unit-php7.3-v10.yml' + - '/.gitlab/pipeline/jobs/unit-php7.4-v9.yml' + - '/.gitlab/pipeline/jobs/unit-php7.4-v10.yml' + - '/.gitlab/pipeline/jobs/xliff-lint.yml' + - '/.gitlab/pipeline/jobs/yaml-lint.yml' - template: Security/License-Scanning.gitlab-ci.yml - template: Security/Secret-Detection.gitlab-ci.yml - template: Security/SAST.gitlab-ci.yml - -variables: - MYSQL_ROOT_PASSWORD: root - typo3DatabaseName: typo3 - typo3DatabaseHost: mariadb - typo3DatabaseUsername: root - typo3DatabasePassword: root - -.default: - image: php:7.4 - before_script: - - bash .gitlab/build/docker_install.sh > /dev/null - -.default-frontend: - image: node:latest - needs: [ ] - cache: - key: "$CI_PROJECT_ID" - paths: - - Resources/Private/node_modules/ - - Resources/Private/.yarn - before_script: - - npm install -g eslint - - cd ./Resources/Private - - yarn install --cache-folder .yarn - -build-composer-dependencies: - extends: .default - stage: build - needs: [ ] - variables: - COMPOSER_CACHE_DIR: '.composer' - script: - - composer --version - - COMPOSER_CACHE_DIR=.composer - composer install --prefer-dist --no-progress --optimize-autoloader - artifacts: - when: on_success - expire_in: 2 weeks - paths: - - .Build - cache: - paths: - - .composer - - .Build - -php-lint-php7.2: - extends: .default - image: php:7.2 - stage: lint - needs: [ ] - script: - - composer ci:php:lint - -php-lint-php7.3: - extends: .default - image: php:7.3 - stage: lint - needs: [ ] - script: - - composer ci:php:lint - -php-lint-php7.4: - extends: .default - image: php:7.4 - stage: lint - needs: [ ] - script: - - composer ci:php:lint - -ts-lint: - extends: .default - stage: lint - needs: - - build-composer-dependencies - script: - - composer ci:ts:lint - -json-lint: - extends: .default - stage: lint - needs: - - build-composer-dependencies - script: - - composer ci:json:lint - -yaml-lint: - extends: .default - stage: lint - needs: - - build-composer-dependencies - script: - - composer ci:yaml:lint - -xliff-lint: - extends: .default - stage: lint - needs: - - build-composer-dependencies - script: - - wget https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd - - xmllint --schema ./xliff-core-1.2-strict.xsd - --noout $(find Resources -name '*.xlf') - -javascript-lint: - extends: .default-frontend - stage: lint - script: - - yarn lint:js - -style-lint: - extends: .default-frontend - stage: lint - script: - - yarn lint:style - -unit-php7.2-v10: - extends: .default - image: php:7.2 - stage: test - needs: - - build-composer-dependencies - - php-lint-php7.2 - script: - - composer require --no-progress typo3/minimal:"^10.4" - - composer ci:tests:unit - -unit-php7.3-v10: - extends: .default - image: php:7.3 - stage: test - needs: - - build-composer-dependencies - - php-lint-php7.3 - script: - - composer require --no-progress typo3/minimal:"^10.4" - - composer ci:tests:unit - -unit-php7.4-v10: - extends: .default - image: php:7.4 - stage: test - needs: - - build-composer-dependencies - - php-lint-php7.4 - script: - - composer require --no-progress typo3/minimal:"^10.4" - - composer ci:tests:unit - -func-php7.2-v10: - extends: .default - image: php:7.2 - services: - - mariadb:10 - stage: test - needs: - - build-composer-dependencies - - php-lint-php7.2 - script: - - composer require --no-progress typo3/minimal:"^10.4" - - composer ci:tests:functional - -func-php7.3-v10: - extends: .default - image: php:7.3 - services: - - mariadb:10 - stage: test - needs: - - build-composer-dependencies - - php-lint-php7.3 - script: - - composer require --no-progress typo3/minimal:"^10.4" - - composer ci:tests:functional - -func-php7.4-v10: - extends: .default - image: php:7.4 - services: - - mariadb:10 - stage: test - needs: - - build-composer-dependencies - - php-lint-php7.4 - script: - - composer require --no-progress typo3/minimal:"^10.4" - - composer ci:tests:functional - -unit-php7.2-v9: - extends: .default - image: php:7.2 - stage: test - dependencies: [ ] - needs: - - build-composer-dependencies - - php-lint-php7.2 - script: - - composer require --no-progress typo3/minimal:"^9.5" - - composer ci:tests:unit - -unit-php7.3-v9: - extends: .default - image: php:7.3 - stage: test - dependencies: [ ] - needs: - - build-composer-dependencies - - php-lint-php7.3 - script: - - composer require --no-progress typo3/minimal:"^9.5" - - composer ci:tests:unit - -unit-php7.4-v9: - extends: .default - image: php:7.4 - stage: test - dependencies: [ ] - needs: - - build-composer-dependencies - - php-lint-php7.4 - script: - - composer require --no-progress typo3/minimal:"^9.5" - - composer ci:tests:unit - -func-php7.2-v9: - extends: .default - image: php:7.2 - services: - - mariadb:10 - stage: test - dependencies: [ ] - needs: - - build-composer-dependencies - - php-lint-php7.2 - script: - - composer require --no-progress typo3/minimal:"^9.5" - - composer ci:tests:functional - -func-php7.3-v9: - extends: .default - image: php:7.3 - services: - - mariadb:10 - stage: test - dependencies: [ ] - needs: - - build-composer-dependencies - - php-lint-php7.3 - script: - - composer require --no-progress typo3/minimal:"^9.5" - - composer ci:tests:functional - -func-php7.4-v9: - extends: .default - image: php:7.4 - services: - - mariadb:10 - stage: test - dependencies: [ ] - needs: - - build-composer-dependencies - - php-lint-php7.4 - script: - - composer require --no-progress typo3/minimal:"^9.5" - - composer ci:tests:functional - -phpcs: - extends: .default - stage: codestyle - needs: - - build-composer-dependencies - - php-lint-php7.2 - - php-lint-php7.3 - - php-lint-php7.4 - script: - - composer ci:php:sniff - -php-copypaste-check: - extends: .default - stage: codestyle - needs: - - build-composer-dependencies - - php-lint-php7.2 - - php-lint-php7.3 - - php-lint-php7.4 - script: - - composer ci:php:copypaste - -phpstan: - extends: .default - stage: codestyle - needs: - - build-composer-dependencies - - php-lint-php7.2 - - php-lint-php7.3 - - php-lint-php7.4 - script: - - composer ci:php:stan - -composer-normalize: - extends: .default - stage: codestyle - script: - - composer ci:composer:normalize diff --git a/.gitlab/pipeline/jobs/.default-frontend.yml b/.gitlab/pipeline/jobs/.default-frontend.yml new file mode 100644 index 0000000..13e1713 --- /dev/null +++ b/.gitlab/pipeline/jobs/.default-frontend.yml @@ -0,0 +1,12 @@ +.default-frontend: + image: node:latest + needs: [ ] + cache: + key: "$CI_PROJECT_ID" + paths: + - Resources/Private/node_modules/ + - Resources/Private/.yarn + before_script: + - npm install -g eslint + - cd ./Resources/Private + - yarn install --cache-folder .yarn diff --git a/.gitlab/pipeline/jobs/.default.yml b/.gitlab/pipeline/jobs/.default.yml new file mode 100644 index 0000000..d4423d4 --- /dev/null +++ b/.gitlab/pipeline/jobs/.default.yml @@ -0,0 +1,4 @@ +.default: + image: php:7.4 + before_script: + - bash .gitlab/build/docker_install.sh > /dev/null diff --git a/.gitlab/pipeline/jobs/.variables.yml b/.gitlab/pipeline/jobs/.variables.yml new file mode 100644 index 0000000..07ca426 --- /dev/null +++ b/.gitlab/pipeline/jobs/.variables.yml @@ -0,0 +1,6 @@ +variables: + MYSQL_ROOT_PASSWORD: root + typo3DatabaseName: typo3 + typo3DatabaseHost: mariadb + typo3DatabaseUsername: root + typo3DatabasePassword: root diff --git a/.gitlab/pipeline/jobs/build-composer-dependencies.yml b/.gitlab/pipeline/jobs/build-composer-dependencies.yml new file mode 100644 index 0000000..02da4c5 --- /dev/null +++ b/.gitlab/pipeline/jobs/build-composer-dependencies.yml @@ -0,0 +1,19 @@ +build-composer-dependencies: + extends: .default + stage: build + needs: [ ] + variables: + COMPOSER_CACHE_DIR: '.composer' + script: + - composer --version + - COMPOSER_CACHE_DIR=.composer + composer install --prefer-dist --no-progress --optimize-autoloader + artifacts: + when: on_success + expire_in: 2 weeks + paths: + - .Build + cache: + paths: + - .composer + - .Build diff --git a/.gitlab/pipeline/jobs/composer-normalize.yml b/.gitlab/pipeline/jobs/composer-normalize.yml new file mode 100644 index 0000000..f4327af --- /dev/null +++ b/.gitlab/pipeline/jobs/composer-normalize.yml @@ -0,0 +1,5 @@ +composer-normalize: + extends: .default + stage: codestyle + script: + - composer ci:composer:normalize diff --git a/.gitlab/pipeline/jobs/func-php7.2-v10.yml b/.gitlab/pipeline/jobs/func-php7.2-v10.yml new file mode 100644 index 0000000..204b601 --- /dev/null +++ b/.gitlab/pipeline/jobs/func-php7.2-v10.yml @@ -0,0 +1,12 @@ +func-php7.2-v10: + extends: .default + image: php:7.2 + services: + - mariadb:10 + stage: test + needs: + - build-composer-dependencies + - php-lint-php7.2 + script: + - composer require --no-progress typo3/minimal:"^10.4" + - composer ci:tests:functional diff --git a/.gitlab/pipeline/jobs/func-php7.2-v9.yml b/.gitlab/pipeline/jobs/func-php7.2-v9.yml new file mode 100644 index 0000000..3229fbe --- /dev/null +++ b/.gitlab/pipeline/jobs/func-php7.2-v9.yml @@ -0,0 +1,13 @@ +func-php7.2-v9: + extends: .default + image: php:7.2 + services: + - mariadb:10 + stage: test + dependencies: [ ] + needs: + - build-composer-dependencies + - php-lint-php7.2 + script: + - composer require --no-progress typo3/minimal:"^9.5" + - composer ci:tests:functional diff --git a/.gitlab/pipeline/jobs/func-php7.3-v10.yml b/.gitlab/pipeline/jobs/func-php7.3-v10.yml new file mode 100644 index 0000000..2f2fa29 --- /dev/null +++ b/.gitlab/pipeline/jobs/func-php7.3-v10.yml @@ -0,0 +1,12 @@ +func-php7.3-v10: + extends: .default + image: php:7.3 + services: + - mariadb:10 + stage: test + needs: + - build-composer-dependencies + - php-lint-php7.3 + script: + - composer require --no-progress typo3/minimal:"^10.4" + - composer ci:tests:functional diff --git a/.gitlab/pipeline/jobs/func-php7.3-v9.yml b/.gitlab/pipeline/jobs/func-php7.3-v9.yml new file mode 100644 index 0000000..7f14895 --- /dev/null +++ b/.gitlab/pipeline/jobs/func-php7.3-v9.yml @@ -0,0 +1,13 @@ +func-php7.3-v9: + extends: .default + image: php:7.3 + services: + - mariadb:10 + stage: test + dependencies: [ ] + needs: + - build-composer-dependencies + - php-lint-php7.3 + script: + - composer require --no-progress typo3/minimal:"^9.5" + - composer ci:tests:functional diff --git a/.gitlab/pipeline/jobs/func-php7.4-v10.yml b/.gitlab/pipeline/jobs/func-php7.4-v10.yml new file mode 100644 index 0000000..6c30e38 --- /dev/null +++ b/.gitlab/pipeline/jobs/func-php7.4-v10.yml @@ -0,0 +1,12 @@ +func-php7.4-v10: + extends: .default + image: php:7.4 + services: + - mariadb:10 + stage: test + needs: + - build-composer-dependencies + - php-lint-php7.4 + script: + - composer require --no-progress typo3/minimal:"^10.4" + - composer ci:tests:functional diff --git a/.gitlab/pipeline/jobs/func-php7.4-v9.yml b/.gitlab/pipeline/jobs/func-php7.4-v9.yml new file mode 100644 index 0000000..03bcd82 --- /dev/null +++ b/.gitlab/pipeline/jobs/func-php7.4-v9.yml @@ -0,0 +1,13 @@ +func-php7.4-v9: + extends: .default + image: php:7.4 + services: + - mariadb:10 + stage: test + dependencies: [ ] + needs: + - build-composer-dependencies + - php-lint-php7.4 + script: + - composer require --no-progress typo3/minimal:"^9.5" + - composer ci:tests:functional diff --git a/.gitlab/pipeline/jobs/javascript-lint.yml b/.gitlab/pipeline/jobs/javascript-lint.yml new file mode 100644 index 0000000..c1f8e5a --- /dev/null +++ b/.gitlab/pipeline/jobs/javascript-lint.yml @@ -0,0 +1,11 @@ +javascript-lint: + extends: .default-frontend + stage: lint + script: + - yarn lint:js + +style-lint: + extends: .default-frontend + stage: lint + script: + - yarn lint:style diff --git a/.gitlab/pipeline/jobs/json-lint.yml b/.gitlab/pipeline/jobs/json-lint.yml new file mode 100644 index 0000000..fc75f61 --- /dev/null +++ b/.gitlab/pipeline/jobs/json-lint.yml @@ -0,0 +1,7 @@ +json-lint: + extends: .default + stage: lint + needs: + - build-composer-dependencies + script: + - composer ci:json:lint diff --git a/.gitlab/pipeline/jobs/php-copypaste-check.yml b/.gitlab/pipeline/jobs/php-copypaste-check.yml new file mode 100644 index 0000000..1aa04ee --- /dev/null +++ b/.gitlab/pipeline/jobs/php-copypaste-check.yml @@ -0,0 +1,10 @@ +php-copypaste-check: + extends: .default + stage: codestyle + needs: + - build-composer-dependencies + - php-lint-php7.2 + - php-lint-php7.3 + - php-lint-php7.4 + script: + - composer ci:php:copypaste diff --git a/.gitlab/pipeline/jobs/php-lint-php7.2.yml b/.gitlab/pipeline/jobs/php-lint-php7.2.yml new file mode 100644 index 0000000..e0749af --- /dev/null +++ b/.gitlab/pipeline/jobs/php-lint-php7.2.yml @@ -0,0 +1,7 @@ +php-lint-php7.2: + extends: .default + image: php:7.2 + stage: lint + needs: [ ] + script: + - composer ci:php:lint diff --git a/.gitlab/pipeline/jobs/php-lint-php7.3.yml b/.gitlab/pipeline/jobs/php-lint-php7.3.yml new file mode 100644 index 0000000..d02e0ec --- /dev/null +++ b/.gitlab/pipeline/jobs/php-lint-php7.3.yml @@ -0,0 +1,7 @@ +php-lint-php7.3: + extends: .default + image: php:7.3 + stage: lint + needs: [ ] + script: + - composer ci:php:lint diff --git a/.gitlab/pipeline/jobs/php-lint-php7.4.yml b/.gitlab/pipeline/jobs/php-lint-php7.4.yml new file mode 100644 index 0000000..0c30cef --- /dev/null +++ b/.gitlab/pipeline/jobs/php-lint-php7.4.yml @@ -0,0 +1,7 @@ +php-lint-php7.4: + extends: .default + image: php:7.4 + stage: lint + needs: [ ] + script: + - composer ci:php:lint diff --git a/.gitlab/pipeline/jobs/phpcs.yml b/.gitlab/pipeline/jobs/phpcs.yml new file mode 100644 index 0000000..2861868 --- /dev/null +++ b/.gitlab/pipeline/jobs/phpcs.yml @@ -0,0 +1,10 @@ +phpcs: + extends: .default + stage: codestyle + needs: + - build-composer-dependencies + - php-lint-php7.2 + - php-lint-php7.3 + - php-lint-php7.4 + script: + - composer ci:php:sniff diff --git a/.gitlab/pipeline/jobs/phpstan.yml b/.gitlab/pipeline/jobs/phpstan.yml new file mode 100644 index 0000000..addfe2f --- /dev/null +++ b/.gitlab/pipeline/jobs/phpstan.yml @@ -0,0 +1,10 @@ +phpstan: + extends: .default + stage: codestyle + needs: + - build-composer-dependencies + - php-lint-php7.2 + - php-lint-php7.3 + - php-lint-php7.4 + script: + - composer ci:php:stan diff --git a/.gitlab/pipeline/jobs/ts-lint.yml b/.gitlab/pipeline/jobs/ts-lint.yml new file mode 100644 index 0000000..a67a075 --- /dev/null +++ b/.gitlab/pipeline/jobs/ts-lint.yml @@ -0,0 +1,7 @@ +ts-lint: + extends: .default + stage: lint + needs: + - build-composer-dependencies + script: + - composer ci:ts:lint diff --git a/.gitlab/pipeline/jobs/unit-php7.2-v10.yml b/.gitlab/pipeline/jobs/unit-php7.2-v10.yml new file mode 100644 index 0000000..c99ed76 --- /dev/null +++ b/.gitlab/pipeline/jobs/unit-php7.2-v10.yml @@ -0,0 +1,10 @@ +unit-php7.2-v10: + extends: .default + image: php:7.2 + stage: test + needs: + - build-composer-dependencies + - php-lint-php7.2 + script: + - composer require --no-progress typo3/minimal:"^10.4" + - composer ci:tests:unit diff --git a/.gitlab/pipeline/jobs/unit-php7.2-v9.yml b/.gitlab/pipeline/jobs/unit-php7.2-v9.yml new file mode 100644 index 0000000..0e06b03 --- /dev/null +++ b/.gitlab/pipeline/jobs/unit-php7.2-v9.yml @@ -0,0 +1,11 @@ +unit-php7.2-v9: + extends: .default + image: php:7.2 + stage: test + dependencies: [ ] + needs: + - build-composer-dependencies + - php-lint-php7.2 + script: + - composer require --no-progress typo3/minimal:"^9.5" + - composer ci:tests:unit diff --git a/.gitlab/pipeline/jobs/unit-php7.3-v10.yml b/.gitlab/pipeline/jobs/unit-php7.3-v10.yml new file mode 100644 index 0000000..f6e9243 --- /dev/null +++ b/.gitlab/pipeline/jobs/unit-php7.3-v10.yml @@ -0,0 +1,10 @@ +unit-php7.3-v10: + extends: .default + image: php:7.3 + stage: test + needs: + - build-composer-dependencies + - php-lint-php7.3 + script: + - composer require --no-progress typo3/minimal:"^10.4" + - composer ci:tests:unit diff --git a/.gitlab/pipeline/jobs/unit-php7.3-v9.yml b/.gitlab/pipeline/jobs/unit-php7.3-v9.yml new file mode 100644 index 0000000..9f3739b --- /dev/null +++ b/.gitlab/pipeline/jobs/unit-php7.3-v9.yml @@ -0,0 +1,11 @@ +unit-php7.3-v9: + extends: .default + image: php:7.3 + stage: test + dependencies: [ ] + needs: + - build-composer-dependencies + - php-lint-php7.3 + script: + - composer require --no-progress typo3/minimal:"^9.5" + - composer ci:tests:unit diff --git a/.gitlab/pipeline/jobs/unit-php7.4-v10.yml b/.gitlab/pipeline/jobs/unit-php7.4-v10.yml new file mode 100644 index 0000000..4a066af --- /dev/null +++ b/.gitlab/pipeline/jobs/unit-php7.4-v10.yml @@ -0,0 +1,10 @@ +unit-php7.4-v10: + extends: .default + image: php:7.4 + stage: test + needs: + - build-composer-dependencies + - php-lint-php7.4 + script: + - composer require --no-progress typo3/minimal:"^10.4" + - composer ci:tests:unit diff --git a/.gitlab/pipeline/jobs/unit-php7.4-v9.yml b/.gitlab/pipeline/jobs/unit-php7.4-v9.yml new file mode 100644 index 0000000..faad15e --- /dev/null +++ b/.gitlab/pipeline/jobs/unit-php7.4-v9.yml @@ -0,0 +1,11 @@ +unit-php7.4-v9: + extends: .default + image: php:7.4 + stage: test + dependencies: [ ] + needs: + - build-composer-dependencies + - php-lint-php7.4 + script: + - composer require --no-progress typo3/minimal:"^9.5" + - composer ci:tests:unit diff --git a/.gitlab/pipeline/jobs/xliff-lint.yml b/.gitlab/pipeline/jobs/xliff-lint.yml new file mode 100644 index 0000000..cee6bca --- /dev/null +++ b/.gitlab/pipeline/jobs/xliff-lint.yml @@ -0,0 +1,9 @@ +xliff-lint: + extends: .default + stage: lint + needs: + - build-composer-dependencies + script: + - wget https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd + - xmllint --schema ./xliff-core-1.2-strict.xsd + --noout $(find Resources -name '*.xlf') diff --git a/.gitlab/pipeline/jobs/yaml-lint.yml b/.gitlab/pipeline/jobs/yaml-lint.yml new file mode 100644 index 0000000..1b006a4 --- /dev/null +++ b/.gitlab/pipeline/jobs/yaml-lint.yml @@ -0,0 +1,7 @@ +yaml-lint: + extends: .default + stage: lint + needs: + - build-composer-dependencies + script: + - composer ci:yaml:lint