.gitlab-ci.yml 3.7 KB
Newer Older
1
2
include:
  - project: 't3o/t3olayout'
3
    ref: main
4
5
    file: '/Configuration/GitLab/t3o-builds.yml'

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
35
36
37
    - set -xe
    - apt-get update -yqq
    - apt-get install git unzip zlib1g-dev libzip-dev -yqq
    - docker-php-ext-install zip
    - pecl install xdebug
    - 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 install --ignore-platform-reqs
Thomas Löffler's avatar
Thomas Löffler committed
43
    - composer test:unit
Thomas Löffler's avatar
Thomas Löffler committed
44
  artifacts:
45
    expire_in: 15 mins
Thomas Löffler's avatar
Thomas Löffler committed
46
47
    reports:
      junit: build/*-report.xml
48
49
50
51
52
53

test:mutation:
  stage: test
  image: php:7.4
  variables:
    GIT_STRATEGY: "clone"
54
  allow_failure: true
55
56
57
58
59
60
61
62
63
64
65
66
67
  before_script:
    - set -xe
    - apt-get update -yqq
    - apt-get install git unzip zlib1g-dev libzip-dev -yqq
    - docker-php-ext-install zip
    - pecl install xdebug
    - 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:
    - composer install --ignore-platform-reqs
68
    - ./vendor/bin/infection --min-msi=10 --min-covered-msi=75 --threads=4
69
  artifacts:
70
    when: always
71
    paths:
72
      - build/infection-log.json
73
    expire_in: 30 min
74

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