-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (165 loc) · 6.04 KB
/
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
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
name: 'Testing calendarize_external'
'on':
0: push
1: pull_request
push:
branches:
- main
- codingstandards
pull_request:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.1'
- '8.2'
typo3:
- '10.4'
- '11.5'
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php }}'
tools: composer
extensions: pdo
-
name: 'Setup problem matchers'
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"\necho \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"\n"
-
name: 'Get composer cache directory'
id: composercache
run: "echo \"dir=$(composer config cache-files-dir)\" >> $GITHUB_OUTPUT\n"
-
name: 'Cache composer dependencies'
uses: actions/cache@v3
with:
path: '${{ steps.composercache.outputs.dir }}'
key: '${{ runner.os }}-composer-${{ hashFiles(''**/composer.lock'') }}'
restore-keys: '${{ runner.os }}-composer-'
-
name: 'Install the right version'
run: 'composer require "typo3/cms-core:^${{ matrix.typo3 }}" "typo3/cms-workspaces:^${{ matrix.typo3 }}" -W'
-
name: 'Unit Tests with phpunit'
run: 'composer run tool:phpunit --'
-
name: 'Start MySQL'
run: 'sudo /etc/init.d/mysql start'
-
name: 'Functional Tests'
run: "export typo3DatabaseName=\"typo3\";\nexport typo3DatabaseHost=\"127.0.0.1\";\nexport typo3DatabaseUsername=\"root\";\nexport typo3DatabasePassword=\"root\";\ncomposer run tool:phpunit:functional --\n"
-
name: 'Run PHP CS Fixer checks'
run: 'composer run tool:php-cs-fixer-check'
-
name: 'Reset composer.json'
run: 'git checkout composer.json;'
code-quality:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php_version:
- '8.2'
typo3_version:
- '11.5'
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: 'Install PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php_version }}'
coverage: none
tools: 'composer:v2.4'
-
name: 'Show Composer version'
run: 'composer --version'
-
name: 'Show the Composer configuration'
run: 'composer config --global --list'
-
name: 'Cache dependencies installed with composer'
uses: actions/cache@v3
with:
key: 'php${{ matrix.php_version }}-typo3${{ matrix.typo3_version }}'
path: ~/.cache/composer
restore-keys: "php${{ matrix.php_version }}-composer-\n"
-
name: 'Install Composer dependencies'
run: "composer require typo3/cms-core ^${{ matrix.typo3_version }} --no-progress\ncomposer install --no-progress\n"
-
name: 'Run command'
run: "composer ci:static\n"
code-tests:
name: 'Coverage tests'
runs-on: ubuntu-22.04
env:
DB_DATABASE: typo3
DB_USER: root
DB_PASSWORD: root
DB_HOST: localhost
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: 'Install PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php_version }}'
coverage: none
tools: 'composer:v2.4'
extensions: mysqli
-
name: 'Show Composer version'
run: 'composer --version'
-
name: 'Show the Composer configuration'
run: 'composer config --global --list'
-
name: 'Cache dependencies installed with composer'
uses: actions/cache@v3
with:
key: 'php${{ matrix.php_version }}-typo3${{ matrix.php_version }}'
path: ~/.cache/composer
restore-keys: "php${{ matrix.php_version }}-composer-\n"
-
name: 'Install Composer dependencies'
run: "composer require typo3/cms-core ^${{ matrix.typo3_version }} --no-progress\ncomposer install --no-progress\n"
-
name: 'Start MySQL'
run: 'sudo /etc/init.d/mysql start'
-
run: "export typo3DatabaseName=\"$DB_DATABASE\";\nexport typo3DatabaseHost=\"$DB_HOST\";\nexport typo3DatabaseUsername=\"$DB_USER\";\nexport typo3DatabasePassword=\"$DB_PASSWORD\";\ncomposer ci:coverage\n"
strategy:
fail-fast: false
matrix:
php_version: { }
typo3_version: { }
semgrep:
name: semgrep
runs-on: ubuntu-latest
container:
image: semgrep/semgrep
if: '(github.actor != ''dependabot[bot]'')'
steps:
-
uses: actions/checkout@v4
-
run: 'semgrep scan --config auto --error'
permissions:
contents: read