Skip to content
Snippets Groups Projects
Commit 82e297f0 authored by jurgenhaas's avatar jurgenhaas
Browse files

Further improve settings for extra tests from GitLab

parent ef4480e6
No related branches found
No related tags found
No related merge requests found
......@@ -21,18 +21,6 @@ Update DB:
Build Theme:
extends: '.theme'
Test Code Style:
extends: '.codestyle'
Test PHPUnit:
extends: '.phpunit'
Test Behat:
extends: '.behat'
Test Backstop:
extends: '.backstop'
Deploy:
extends: '.deployartefact'
......
......@@ -21,12 +21,24 @@ include:
file: '/no-staging.yml'
rules:
- if: '$STAGING == "no"'
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml
- template: Code-Quality.gitlab-ci.yml
# See https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/SAST.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Secret-Detection.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
- project: gitlab-ci-cd/drupal
ref: master
file: '/tests/lakedrops.yml'
rules:
- if: '$INITIALINSTALL == "yes"'
when: never
- if: $DISABLE_CI_TESTS
when: never
- project: gitlab-ci-cd/drupal
ref: master
file: '/tests/gitlab.yml'
rules:
- if: '$INITIALINSTALL == "yes"'
when: never
- if: $DISABLE_CI_TESTS
when: never
- if: $DISABLE_GITLAB_CI_TESTS
when: never
stages:
- validation
......@@ -118,30 +130,6 @@ stages:
key: build-prod-${COMPOSE_PROJECT_NAME}
<<: *cache_paths
.test_default: &test_default
stage: test
tags:
- default
variables:
GIT_STRATEGY: none
.test_lakedrops_default: &test_lakedrops_default
<<: *test_default
except:
variables:
- $INITIALINSTALL == "yes"
- $DISABLE_CI_TESTS
.test_gitlab_default: &test_gitlab_default
<<: *test_default
rules:
- if: '$INITIALINSTALL == "yes"'
when: never
- if: $DISABLE_CI_TESTS
when: never
- if: $DISABLE_GITLAB_CI_TESTS
when: never
.prerequisites:
stage: validation
tags:
......@@ -363,92 +351,6 @@ stages:
dependencies:
- 'Build Site'
.codestyle:
<<: *test_lakedrops_default
image: registry.lakedrops.com/docker/gitlab-drupal-ci:php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
script:
- if [[ -f phpcs.xml ]]; then rm phpcs.xml; fi
- ahoy test phpcs -- --report=xml --report-file=/tmp/phpcs.xml
after_script:
- docker cp ${COMPOSE_PROJECT_NAME}-php-1:/tmp/phpcs.xml phpcs.xml
retry: 1
artifacts:
name: phpcs
when: always
paths:
- phpcs.xml
dependencies:
- 'Build Site'
except:
variables:
- $DISABLE_CI_TEST_CODESTYLE
.phpunit:
<<: *test_lakedrops_default
stage: test
image: registry.lakedrops.com/docker/gitlab-drupal-ci:php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
script:
- if [[ -f junit.xml ]]; then rm junit.xml; fi
- if [[ -f testdox.html ]]; then rm testdox.html; fi
- ahoy test phpunit -- --log-junit /tmp/junit.xml --testdox-html testdox.html
after_script:
- docker cp ${COMPOSE_PROJECT_NAME}-php-1:/tmp/junit.xml junit.xml
- docker cp ${COMPOSE_PROJECT_NAME}-php-1:/tmp/testdox.html testdox.html
retry: 1
artifacts:
name: phpunit
when: always
paths:
- junit.xml
- testdox.html
reports:
junit: junit.xml
dependencies:
- 'Build Site'
except:
variables:
- $DISABLE_CI_TEST_PHPUNIT
.behat:
<<: *test_lakedrops_default
image: registry.lakedrops.com/docker/gitlab-drupal-ci:php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
script:
- if [[ -f behat.xml ]]; then rm behat.xml; fi
- ahoy behat update
- ahoy behat exec -- --format junit --out /tmp
after_script:
- docker cp ${COMPOSE_PROJECT_NAME}-php-1:/tmp/default.xml behat.xml
retry: 1
artifacts:
name: behat
when: always
paths:
- behat.xml
dependencies:
- 'Build Site'
except:
variables:
- $DISABLE_CI_TEST_BEHAT
.backstop:
<<: *test_lakedrops_default
image: registry.lakedrops.com/docker/gitlab-drupal-ci:php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
script:
- backstop test
retry: 1
artifacts:
name: backstop
when: always
paths:
- config/backstop_reference
- tests/backstop/backstop_data
dependencies:
- 'Build Site'
- 'Build Theme'
except:
variables:
- $DISABLE_CI_TEST_BACKSTOP
.deploy:
stage: deploy
tags:
......@@ -561,50 +463,3 @@ stages:
- $CHECKUPDATES
refs:
- develop
# ==================================== Code Quality
code_quality:
<<: *test_gitlab_default
variables:
CODE_QUALITY_IMAGE: registry.lakedrops.com/docker/code-climate-drupal/code-climate-drupal
artifacts:
paths:
- gl-code-quality-report.json
rules:
- if: $DISABLE_GITLAB_CI_TESTS_CODE_QUALITY
when: never
# ==================================== SAST
bandit-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_BANDIT_SAST
when: never
eslint-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_ESLINT_SAST
when: never
nodejs-scan-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_NODEJS_SCAN_SAST
when: never
phpcs-security-audit-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_PHPCS_SECURITY_AUDIT_SAST
when: never
semgrep-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_SEMGREP_SAST
when: never
# ==================================== Secret Detection
secret_detection:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_SECRET_DETECTION
when: never
include:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml
- template: Code-Quality.gitlab-ci.yml
# See https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/SAST.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Secret-Detection.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
.test_gitlab_default: &test_gitlab_default
stage: test
tags:
- default
variables:
GIT_STRATEGY: none
# ==================================== Code Quality
code_quality:
<<: *test_gitlab_default
variables:
GIT_STRATEGY: none
CODE_QUALITY_IMAGE: registry.lakedrops.com/docker/code-climate-drupal/code-climate-drupal
artifacts:
paths:
- gl-code-quality-report.json
rules:
- if: $DISABLE_GITLAB_CI_TESTS_CODE_QUALITY
when: never
# ==================================== SAST
bandit-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_BANDIT_SAST
when: never
eslint-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_ESLINT_SAST
when: never
nodejs-scan-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_NODEJS_SCAN_SAST
when: never
phpcs-security-audit-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_PHPCS_SECURITY_AUDIT_SAST
when: never
semgrep-sast:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_SEMGREP_SAST
when: never
# ==================================== Secret Detection
secret_detection:
<<: *test_gitlab_default
rules:
- if: $DISABLE_GITLAB_CI_TESTS_SECRET_DETECTION
when: never
.test_lakedrops_default: &test_lakedrops_default
stage: test
tags:
- default
variables:
GIT_STRATEGY: none
Test Code Style:
<<: *test_lakedrops_default
image: registry.lakedrops.com/docker/gitlab-drupal-ci:php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
script:
- if [[ -f phpcs.xml ]]; then rm phpcs.xml; fi
- ahoy test phpcs -- --report=xml --report-file=/tmp/phpcs.xml
after_script:
- docker cp ${COMPOSE_PROJECT_NAME}-php-1:/tmp/phpcs.xml phpcs.xml
retry: 1
artifacts:
name: phpcs
when: always
paths:
- phpcs.xml
dependencies:
- 'Build Site'
rules:
- if: $DISABLE_CI_TEST_CODESTYLE
when: never
Test PHPUnit:
<<: *test_lakedrops_default
stage: test
image: registry.lakedrops.com/docker/gitlab-drupal-ci:php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
script:
- if [[ -f junit.xml ]]; then rm junit.xml; fi
- if [[ -f testdox.html ]]; then rm testdox.html; fi
- ahoy test phpunit -- --log-junit /tmp/junit.xml --testdox-html testdox.html
after_script:
- docker cp ${COMPOSE_PROJECT_NAME}-php-1:/tmp/junit.xml junit.xml
- docker cp ${COMPOSE_PROJECT_NAME}-php-1:/tmp/testdox.html testdox.html
retry: 1
artifacts:
name: phpunit
when: always
paths:
- junit.xml
- testdox.html
reports:
junit: junit.xml
dependencies:
- 'Build Site'
rules:
- if: $DISABLE_CI_TEST_PHPUNIT
when: never
Test Behat:
<<: *test_lakedrops_default
image: registry.lakedrops.com/docker/gitlab-drupal-ci:php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
script:
- if [[ -f behat.xml ]]; then rm behat.xml; fi
- ahoy behat update
- ahoy behat exec -- --format junit --out /tmp
after_script:
- docker cp ${COMPOSE_PROJECT_NAME}-php-1:/tmp/default.xml behat.xml
retry: 1
artifacts:
name: behat
when: always
paths:
- behat.xml
dependencies:
- 'Build Site'
rules:
- if: $DISABLE_CI_TEST_BEHAT
when: never
Test Backstop:
<<: *test_lakedrops_default
image: registry.lakedrops.com/docker/gitlab-drupal-ci:php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
script:
- backstop test
retry: 1
artifacts:
name: backstop
when: always
paths:
- config/backstop_reference
- tests/backstop/backstop_data
dependencies:
- 'Build Site'
- 'Build Theme'
rules:
- if: $DISABLE_CI_TEST_BACKSTOP
when: never
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment