forked from TYPO3-Console/TYPO3-Console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
165 lines (153 loc) · 5.31 KB
/
.travis.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
language: php
sudo: required
addons:
sonarcloud:
organization: "helhum-github"
branches:
- master
- develop
jdk:
- oraclejdk8
cache:
directories:
- $HOME/.composer/cache
- $HOME/.sonar/cache
# Do not build feature branches or alpha/beta releases
branches:
only:
- master
- develop
- /^v?([0-9]+\.){1,2}(x|[0-9]+)$/
# Inform me about failures
notifications:
email:
# This is executed for all stages
before_install:
- if php -i | grep -v TRAVIS_CMD | grep -q xdebug; then phpenv config-rm xdebug.ini; fi
- mkdir -p .Build/external
- git clone https://github.com/helhum/TYPO3-testing-framework.git .Build/external/nimut-testing-framework -b allow-php73
- composer config repositories.testing-framework vcs .Build/external/nimut-testing-framework
install:
- export COMPOSER_ROOT_VERSION=5.7.0
- |
composer require \
typo3/cms-backend="$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" \
$PREFER_LOWEST
- git checkout composer.json
# Test scripts
script:
- .Build/bin/parallel-lint --exclude .Build .
# This fails when command reference is not up to date
- ./typo3cms commandreference:render > /dev/null 2>&1 && test -z "$(git diff --shortstat 2> /dev/null | tail -n1)";
- git diff
- .Build/bin/phpunit;
# Configure build stages (with build matrix above, test stage is implicitly defined)
jobs:
allow_failures:
- env: TYPO3_VERSION="dev-master"
include:
- stage: test
php: 7.3
env: TYPO3_VERSION="~9.5.0" TYPO3_UPGRADE_FROM_VERSION="~9.5.0"
- stage: test
php: 7.2
env: TYPO3_VERSION="~9.5.0"
- stage: test
php: 7.2
env: TYPO3_VERSION=^8.7.22
- stage: test
php: 7.1
env: TYPO3_VERSION=^8.7.22
- stage: test
php: 7.0
env: TYPO3_VERSION=^8.7.22
- stage: test
php: 7.0
env: TYPO3_VERSION=^8.7.22 PREFER_LOWEST="--prefer-lowest"
- stage: test
php: 7.2
env: TYPO3_VERSION="dev-master"
- stage: test
php: 7.0
env: Consistency checks
install: skip
before_script: skip
script:
- >
if [ -n "$TRAVIS_TAG" ]; then
composer set-version $(echo $TRAVIS_TAG | sed s/^v//g)
test -z "$(git diff --shortstat 2> /dev/null | tail -n1)";
fi
- composer extension-verify-composer-json
- composer extension-release
- stage: sonar code scanner
if: type = push AND branch IN (master, develop)
php: 7.2
before_install: skip
install: skip
before_script:
- mkdir -p .Build/external
- git clone https://github.com/helhum/TYPO3-testing-framework.git .Build/external/nimut-testing-framework -b allow-php73
- composer config repositories.testing-framework vcs .Build/external/nimut-testing-framework
script:
- git fetch --unshallow
- export COMPOSER_ROOT_VERSION=5.7.0
- composer install
- .Build/bin/phpunit --whitelist Classes --coverage-clover .Build/clover.xml --log-junit .Build/junit.xml
- >
if [ -n "$SONAR_TOKEN" ]; then
sonar-scanner
fi
- stage: update extension repo
if: type = push
php: 7.2
before_install: skip
install: skip
before_script:
- mkdir -p ~/.ssh
- openssl aes-256-cbc -K $encrypted_85bf36ae99bb_key -iv $encrypted_85bf36ae99bb_iv -in Resources/Private/deploy_rsa.enc -out ~/.ssh/id_rsa -d
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- chmod 600 ~/.ssh/id_rsa
- git clone [email protected]:TYPO3-Console/Extension.git ../extension -b template
- cd ../extension && git checkout origin/$TRAVIS_BRANCH || true && cd -
- composer extension-release
- cd ../extension
- git checkout README.md
- git add .
script:
- |
if [ -n "$TRAVIS_TAG" ]; then
git commit -m "Release extension version $TRAVIS_TAG" --author "Helmut Hummel <[email protected]>"
git tag $TRAVIS_TAG
git push --tags
else
git commit -m "Update extension based on commit $TRAVIS_COMMIT" --author "Helmut Hummel <[email protected]>"
git push origin HEAD:$TRAVIS_BRANCH
fi;
- stage: 🚢 to TER
if: tag IS present
php: 7.0
install: skip
before_script: skip
script:
- |
if [ -n "$TYPO3_ORG_USERNAME" ] && [ -n "$TYPO3_ORG_PASSWORD" ]; then
echo -e "Preparing upload of release ${TRAVIS_TAG} to TER\n";
# Install ter client
composer global require helhum/ter-client
# Build extension files
composer extension-release
# Upload
TAG_MESSAGE=`git tag -n10 -l $TRAVIS_TAG | sed 's/^[0-9.]*[ ]*//g'`
echo "Uploading release ${TRAVIS_TAG} to TER"
$HOME/.composer/vendor/bin/ter-client upload typo3_console ../extension -u "$TYPO3_ORG_USERNAME" -p "$TYPO3_ORG_PASSWORD" -m "$TAG_MESSAGE"
fi;