.gitlab-ci.yml 3.81 KB
Newer Older
1
include:
2
  - project: 'services/t3o-sites/common/t3o-basic-pipeline-jobs'
3
    ref: main
4
    file: 't3o-basic-pipeline-jobs.yml'
5

6
stages:
7
  - maintenance
8 9 10 11 12
  - dump
  - test
  - build
  - layout
  - deploy
Thomas Löffler's avatar
Thomas Löffler committed
13
  - badges
Thomas Löffler's avatar
Thomas Löffler committed
14

15
variables:
16 17
  GIT_STRATEGY: "none"
  GIT_SSL_NO_VERIFY: "true"
18
  STAGE_HOST: "extensions.typo3.dev"
19 20
  PRODUCTION_PORT: 22
  PRODUCTION_HOST: "t3o03.typo3server.ch"
21
  STAGE_USER: "extensions-stage"
22
  DUMP_EXCLUDE_TABLES_LIST: "be_groups,be_sessions,be_users,cf_cache_hash,cf_cache_hash_tags,cf_cache_imagesizes,cf_cache_imagesizes_tags,cf_cache_news_category,cf_cache_news_category_tags,cf_cache_pages,cf_cache_pages_tags,cf_cache_pagesection,cf_cache_pagesection_tags,cf_cache_rootline,cf_cache_rootline_tags,cf_extbase_datamapfactory_datamap,cf_extbase_datamapfactory_datamap_tags,cf_extbase_object,cf_extbase_object_tags,cf_extbase_reflection,cf_extbase_reflection_tags,cf_tx_solr,cf_tx_solr_configuration,cf_tx_solr_configuration_tags,cf_tx_solr_tags,fe_groups,fe_sessions,fe_users,sys_domain,sys_log,tx_solr_cache,tx_solr_cache_tags"
23
  ADDITIONAL_TABLE_EXCLUDES: "-e 'tx_terfe2_domain_model_author' -e 'tx_ter_extensiondetails' -e 'tx_terfe2_extension_*_mm'"
24

25
test:unit:
Thomas Löffler's avatar
Thomas Löffler committed
26
  stage: test
27
  image: php:7.4
28
  variables:
Thomas Löffler's avatar
Thomas Löffler committed
29
    GIT_STRATEGY: "clone"
Thomas Löffler's avatar
Thomas Löffler committed
30
  before_script:
31 32 33 34
    - set -xe
    - apt-get update -yqq
    - apt-get install git unzip zlib1g-dev libzip-dev -yqq
    - docker-php-ext-install zip
Thomas Löffler's avatar
Thomas Löffler committed
35
    - pecl install xdebug-2.9.2
36 37
    - docker-php-ext-enable xdebug
    - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
Thomas Löffler's avatar
Thomas Löffler committed
38
    - export TYPO3_PATH_WEB="$PWD/private"
39
    - composer config cache-dir /cache/composer
Thomas Löffler's avatar
Thomas Löffler committed
40
    - mkdir $TYPO3_PATH_WEB/fileadmin/ && touch $TYPO3_PATH_WEB/fileadmin/currentcoredata.json
Thomas Löffler's avatar
Thomas Löffler committed
41
  script:
42
    - composer selfupdate --1
43
    - composer install --ignore-platform-reqs
Thomas Löffler's avatar
Thomas Löffler committed
44
    - composer test:unit
Thomas Löffler's avatar
Thomas Löffler committed
45
  artifacts:
46
    expire_in: 15 mins
Thomas Löffler's avatar
Thomas Löffler committed
47 48
    reports:
      junit: build/*-report.xml
49 50 51 52 53 54

test:mutation:
  stage: test
  image: php:7.4
  variables:
    GIT_STRATEGY: "clone"
55
  allow_failure: true
56 57 58 59 60
  before_script:
    - set -xe
    - apt-get update -yqq
    - apt-get install git unzip zlib1g-dev libzip-dev -yqq
    - docker-php-ext-install zip
Thomas Löffler's avatar
Thomas Löffler committed
61
    - pecl install xdebug-2.9.2
62 63 64 65 66 67
    - docker-php-ext-enable xdebug
    - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
    - export TYPO3_PATH_WEB="$PWD/private"
    - composer config cache-dir /cache/composer
    - mkdir $TYPO3_PATH_WEB/fileadmin/ && touch $TYPO3_PATH_WEB/fileadmin/currentcoredata.json
  script:
68
    - composer selfupdate --2
69
    - composer install --ignore-platform-reqs
70
    - ./vendor/bin/infection --min-msi=10 --min-covered-msi=75 --threads=4
71
  retry: 2
72
  artifacts:
73
    when: always
74
    paths:
75
      - build/infection-log.json
76
    expire_in: 30 min
77

78 79
mutation:badge:
  stage: badges
80
  image: python:3.9
81
  allow_failure: true
82 83
  before_script:
    - echo "Python other dependencies installation"
84 85
    - pip3 install anybadge
    - apt update -y
86
    - apt install -y jq bc
87 88
    - mkdir badges
    - cd badges
89
  script:
90
    - mutation_msi=$(cat ../build/infection-log.json | jq .stats.msi)
Tomas Norre Mikkelsen's avatar
Tomas Norre Mikkelsen committed
91
    - msi_color=$(../.gitlab-ci/build/./badge-color.sh $mutation_msi)
92 93
    - anybadge -l "Mutation MSI" -v $mutation_msi -f mutation_msi.svg -c $msi_color
    - mutation_mcc=$(cat ../build/infection-log.json | jq .stats.mutationCodeCoverage)
Tomas Norre Mikkelsen's avatar
Tomas Norre Mikkelsen committed
94
    - mcc_color=$(../.gitlab-ci/build/./badge-color.sh $mutation_mcc)
95 96
    - anybadge -l "Mutation MCC" -v $mutation_mcc -f mutation_mcc.svg -c $mcc_color
    - mutation_ccmsi=$(cat ../build/infection-log.json | jq .stats.coveredCodeMsi)
Tomas Norre Mikkelsen's avatar
Tomas Norre Mikkelsen committed
97
    - ccmsi_color=$(../.gitlab-ci/build/./badge-color.sh $mutation_ccmsi)
98
    - anybadge -l "Mutation CCMSI" -v $mutation_ccmsi -f mutation_ccmsi.svg -c $ccmsi_color
99 100
  artifacts:
    paths:
101 102
      - badges/
    when: always
103
    expire_in: 4 weeks