forked from TYPO3-Console/TYPO3-Console
-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (144 loc) · 7.18 KB
/
Test.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
166
167
168
169
170
171
172
173
174
name: Test
on: [ push, pull_request ]
defaults:
run:
shell: bash
jobs:
Consistency:
name: 'Consistency'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Composer Cache Vars
id: composer-cache-vars
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "timestamp=$(date +"%s")" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-vars.outputs.dir }}
key: ${{ runner.os }}-composer-^11.5.26-stable-8.1-${{ steps.composer-cache-vars.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-composer-^11.5.26-stable-8.1-
${{ runner.os }}-composer-^11.5.26-stable-
${{ runner.os }}-composer-^11.5.26-
${{ runner.os }}-composer-
- name: Set up PHP Version 8.1
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none
- name: "Extract tag, branch, version from GITHUB_REF"
id: "github-ref"
run: |
echo "tag=$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/(.*)$#\1#p')" >> $GITHUB_OUTPUT
echo "branch=$(echo $GITHUB_REF | sed -E -n 's#^refs/heads/(.*)$#\1#p')" >> $GITHUB_OUTPUT
echo "version=$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/v?([0-9]+\.)([0-9]+\.)([0-9]+)#\1\2\3#p')" >> $GITHUB_OUTPUT
- name: Compare tag version with committed version
if: steps.github-ref.outputs.version != ''
run: |
composer set-version $(echo ${{ steps.github-ref.outputs.tag }} | sed s/^v//g)
test -z "$(git diff --shortstat 2> /dev/null | tail -n1)";
- name: Build extension artifact
run: |
composer extension-release
- name: Documentation will render without warnings
run: |
composer docs:test-render
rm -rf Documentation-GENERATED-temp
Tests:
name: 'T3 ${{ matrix.typo3 }} - ${{ matrix.os }} - PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
typo3: [ '^11.5.26', '^12.4' ]
php: [ '8.1', '8.2', '8.3' ]
dependency-version: [ lowest, stable ]
experimental: [ false ]
include:
# - os: 'ubuntu-latest'
# php: 8.2
# typo3: dev-main
# dependency-version: stable
# experimental: true
- os: 'windows-latest'
php: '8.2'
typo3: '^12.4'
dependency-version: stable
experimental: false
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Start database server
if: matrix.os == 'ubuntu-latest'
run: sudo /etc/init.d/mysql start
- name: Checkout
uses: actions/checkout@v4
- name: Composer Cache Vars
id: composer-cache-vars
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "timestamp=$(date +"%s")" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-vars.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-${{ matrix.php }}-${{ steps.composer-cache-vars.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-${{ matrix.php }}-
${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-
${{ runner.os }}-composer-${{ matrix.typo3 }}-
${{ runner.os }}-composer-
- name: Set up PHP Version ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, pdo_sqlite, pdo_mysql
tools: composer:v2
coverage: none
- name: Environment Check
run: |
php --version
composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Patch latest TYPO3
if: matrix.typo3 == '^12.4' && matrix.dependency-version == 'stable'
run: composer require --dev --no-update gilbertsoft/typo3-core-patches
- name: Install
env:
COMPOSER_ROOT_VERSION: 8.1.1
run: |
composer update --with "typo3/cms-core:${{ matrix.typo3 }}" --prefer-${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Patch latest TYPO3 (reset git)
if: matrix.typo3 == '^12.4' && matrix.dependency-version == 'stable'
run: git checkout .
- name: Lint
run: php vendor/bin/parallel-lint --exclude vendor --exclude var --exclude public .
# This fails when command reference is not up to date
- name: Test Command Reference
if: matrix.os == 'ubuntu-latest' && !matrix.experimental
run: |
vendor/bin/typo3 commandreference:render
git diff --exit-code
- name: Test Install (Unix)
if: matrix.os == 'ubuntu-latest' && !matrix.experimental
run: 'php vendor/bin/typo3 install:setup --install-steps-config=Tests/Console/Functional/Fixtures/Install/mysql-install.yaml --no-interaction -vvv'
- name: Test Install (Windows)
if: matrix.os == 'windows-latest' && !matrix.experimental
run: 'php vendor/bin/typo3 install:setup --install-steps-config=Tests/Console/Functional/Fixtures/Install/sqlite-install.yaml --no-interaction -vvv'
- name: Test
if: matrix.os == 'ubuntu-latest' && !matrix.experimental
run: vendor/bin/phpunit
- name: Test - allow failure
if: matrix.experimental
run: vendor/bin/phpunit || true
- name: Test - Windows
if: matrix.os == 'windows-latest'
env:
TYPO3_INSTALL_DB_DRIVER: pdo_sqlite
run: vendor/bin/phpunit