-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
113 lines (106 loc) · 3.35 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
stages:
- lint
- test
- mirror
.composer-install:
before_script:
- mkdir -p .composer/cache
- COMPOSER_CACHE_DIR=.composer/cache composer install
cache:
key: composer-cache
paths:
- .composer/cache
.install-typo3:
before_script:
- mkdir -p .composer/cache
- |
COMPOSER_CACHE_DIR=.composer/cache composer require \
typo3/cms-backend="$TYPO3_VERSION" \
typo3/cms-recordlist="$TYPO3_VERSION" \
typo3/cms-core="$TYPO3_VERSION" \
typo3/cms-extbase="$TYPO3_VERSION" \
typo3/cms-extensionmanager="$TYPO3_VERSION" \
typo3/cms-fluid="$TYPO3_VERSION" \
typo3/cms-frontend="$TYPO3_VERSION" \
typo3/cms-install="$TYPO3_VERSION" \
typo3/cms-scheduler="$TYPO3_VERSION" \
typo3/cms-recordlist="$TYPO3_VERSION"
- echo '<?php return [];' > .Build/Web/typo3conf/LocalConfiguration.php
lint-php:
stage: lint
image: registry.gitlab.com/codemonkey1988/docker-composer-image:2-php$PHP_VERSION
except:
- master
script:
- find . -name \*.php ! -path "./.Build/*" -exec php -d display_errors=stderr -l {} > /dev/null \;
parallel:
matrix:
- PHP_VERSION: ['7.2', '7.3', '7.4', '8.0']
codestyle-php:
extends: .composer-install
stage: lint
image: registry.gitlab.com/codemonkey1988/docker-composer-image:2-php7.4
except:
- master
script:
- .Build/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --dry-run --using-cache=no --diff --diff-format=udiff
unit-tests:
extends:
- .composer-install
- .install-typo3
stage: test
image: registry.gitlab.com/codemonkey1988/docker-composer-image:2-php$PHP_VERSION
except:
- master
script:
- .Build/bin/phpunit --colors -c .Build/vendor/nimut/testing-framework/res/Configuration/UnitTests.xml Tests/Unit/
parallel:
matrix:
- TYPO3_VERSION: 'dev-master'
PHP_VERSION: [ '7.4' ]
- TYPO3_VERSION: '^10.4'
PHP_VERSION: [ '7.2', '7.3', '7.4' ]
- TYPO3_VERSION: '^9.5'
PHP_VERSION: [ '7.2', '7.3', '7.4' ]
functional-tests:
extends:
- .composer-install
- .install-typo3
stage: test
image: registry.gitlab.com/codemonkey1988/docker-composer-image:2-php$PHP_VERSION
except:
- master
services:
- mysql:5.7
variables:
MYSQL_ROOT_PASSWORD: root
typo3DatabaseHost: mysql
typo3DatabaseUsername: root
typo3DatabasePassword: $MYSQL_ROOT_PASSWORD
typo3DatabaseName: typo3_test
typo3DatabaseDriver: mysqli
script:
- .Build/bin/phpunit --colors -c .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml Tests/Functional/
parallel:
matrix:
- TYPO3_VERSION: 'dev-master'
PHP_VERSION: [ '7.4' ]
- TYPO3_VERSION: '^10.4'
PHP_VERSION: [ '7.2', '7.3', '7.4' ]
- TYPO3_VERSION: '^9.5'
PHP_VERSION: [ '7.2', '7.3', '7.4' ]
mirror:
stage: mirror
image: registry.gitlab.com/codemonkey1988/docker-composer-image:2-php7.4
only:
- main
- tags
variables:
GIT_STRATEGY: none
script:
- git clone $CI_REPOSITORY_URL -b main repo && cd repo
- git config user.name "$GIT_USER_NAME"
- git config user.email "$GIT_USER_EMAIL"
- git checkout master && git merge --ff main
- git push https://$GITLAB_USERNAME:M2_$GITLAB_TOKEN@$GITLAB_REPOSITORY
- git push -f --mirror https://$GITHUB_USERNAME:ghp_$GITHUB_TOKEN@$GITHUB_REPOSITORY