forked from spoonerWeb/be_secure_pw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
87 lines (78 loc) · 1.98 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
cache:
key: "$CI_COMMIT_REF_NAME-$CI_JOB_STAGE"
paths:
- /cache/composer
stages:
- test
- release
.unit_tests: &unit_tests
stage: test
image: php:$PHP_VERSION
before_script:
- apt-get update && apt-get install -y bash
- bash ./docker_install.sh > /dev/null
- composer install --ignore-platform-reqs
script:
- composer test:unit
artifacts:
reports:
junit: build/*-report.xml
"Unit Tests with PHP 8.0":
<<: *unit_tests
variables:
PHP_VERSION: '8.0'
"Unit Tests with PHP 8.1":
<<: *unit_tests
variables:
PHP_VERSION: '8.1'
"Unit Tests with PHP 8.2":
<<: *unit_tests
variables:
PHP_VERSION: '8.2'
"PHP CS Fixer":
stage: test
image: composer:2
variables:
PHP_CS_FIXER_IGNORE_ENV: 1
before_script:
- composer install --ignore-platform-reqs
script:
- composer exec "php-cs-fixer fix -n --diff --format junit > php-cs-fixer.xml"
artifacts:
reports:
junit:
- php-cs-fixer.xml
"PHPstan":
stage: test
image: composer:2
before_script:
- composer install --ignore-platform-reqs
script:
- composer exec phpstan
"PHP Rector":
stage: test
image: composer:2
before_script:
- composer install --ignore-platform-reqs
script:
- composer exec rector
"Publish new version to TER":
stage: release
image: composer:2
variables:
TYPO3_EXTENSION_KEY: "be_secure_pw"
only:
- tags
before_script:
- composer global require typo3/tailor
script:
- >
if [ -n "$CI_COMMIT_TAG" ] && [ -n "$TYPO3_API_TOKEN" ] && [ -n "$TYPO3_EXTENSION_KEY" ]; then
echo -e "Preparing upload of release ${CI_COMMIT_TAG} to TER\n"
# Cleanup before we upload
git reset --hard HEAD && git clean -fx
# Upload
TAG_MESSAGE=`git tag -n10 -l $CI_COMMIT_TAG | sed 's/^[0-9.]*[ ]*//g'`
echo "Uploading release ${CI_COMMIT_TAG} to TER"
/tmp/vendor/bin/tailor ter:publish --comment "$TAG_MESSAGE" "$CI_COMMIT_TAG" "$TYPO3_EXTENSION_KEY"
fi;