2021-07-29 11:19:05 -07:00
|
|
|
# You can override the included template(s) by including variable overrides
|
|
|
|
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
|
|
|
|
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
|
|
|
|
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
|
|
|
|
# Note that environment variables can be set in several places
|
|
|
|
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
|
2021-03-04 11:31:59 -08:00
|
|
|
cache:
|
|
|
|
paths:
|
2021-07-29 11:19:05 -07:00
|
|
|
- vendor/
|
2021-03-04 11:31:59 -08:00
|
|
|
variables:
|
|
|
|
XDEBUG_MODE: coverage
|
|
|
|
before_script:
|
2021-03-04 11:41:02 -08:00
|
|
|
- >
|
2021-07-29 11:19:05 -07:00
|
|
|
if [ "$CI_JOB_STAGE" != "security" ]; then
|
|
|
|
apt-get update -yqq && apt-get upgrade -yqq && apt-get install -yqq git libzip-dev unzip zip libpcre3-dev && docker-php-ext-install zip && pecl install xdebug && docker-php-ext-enable xdebug
|
|
|
|
fi
|
|
|
|
- >
|
2021-03-04 11:44:17 -08:00
|
|
|
if [ "$CI_JOB_NAME" == "test:7.4" ] || [ "$CI_JOB_NAME" == "test:8.0" ]; then
|
2021-07-29 11:19:05 -07:00
|
|
|
pecl install ds && docker-php-ext-enable ds
|
|
|
|
fi
|
|
|
|
- >
|
|
|
|
if [ "$CI_JOB_STAGE" != "security" ]; then
|
|
|
|
curl -sS https://getcomposer.org/installer | php
|
|
|
|
php composer.phar install
|
2021-03-04 11:41:02 -08:00
|
|
|
fi
|
2021-03-04 11:31:59 -08:00
|
|
|
test:7.4:
|
|
|
|
only:
|
2021-07-29 11:19:05 -07:00
|
|
|
- branches
|
2021-03-04 11:31:59 -08:00
|
|
|
tags:
|
2021-07-29 11:19:05 -07:00
|
|
|
- default
|
2021-03-04 11:31:59 -08:00
|
|
|
image: php:7.4
|
|
|
|
script:
|
2021-07-29 11:19:05 -07:00
|
|
|
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never
|
2021-03-04 11:31:59 -08:00
|
|
|
test:7.4-without-ext-ds:
|
|
|
|
only:
|
2021-07-29 11:19:05 -07:00
|
|
|
- branches
|
2021-03-04 11:31:59 -08:00
|
|
|
tags:
|
2021-07-29 11:19:05 -07:00
|
|
|
- default
|
2021-03-04 11:31:59 -08:00
|
|
|
image: php:7.4
|
|
|
|
script:
|
2021-07-29 11:19:05 -07:00
|
|
|
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never
|
2021-03-04 11:31:59 -08:00
|
|
|
test:8.0:
|
|
|
|
only:
|
2021-07-29 11:19:05 -07:00
|
|
|
- branches
|
2021-03-04 11:31:59 -08:00
|
|
|
tags:
|
2021-07-29 11:19:05 -07:00
|
|
|
- default
|
2021-03-04 11:31:59 -08:00
|
|
|
image: php:8.0
|
|
|
|
script:
|
2021-07-29 11:19:05 -07:00
|
|
|
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never
|
2021-03-04 11:31:59 -08:00
|
|
|
test:8.0-without-ext-ds:
|
|
|
|
only:
|
2021-07-29 11:19:05 -07:00
|
|
|
- branches
|
2021-03-04 11:31:59 -08:00
|
|
|
tags:
|
2021-07-29 11:19:05 -07:00
|
|
|
- default
|
|
|
|
image: php:8.0
|
2021-03-04 11:31:59 -08:00
|
|
|
script:
|
2021-07-29 11:19:05 -07:00
|
|
|
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never
|
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- security
|
|
|
|
sast:
|
|
|
|
image: ubuntu:latest
|
|
|
|
stage: security
|
|
|
|
include:
|
|
|
|
- template: Security/SAST.gitlab-ci.yml
|