-
-
Notifications
You must be signed in to change notification settings - Fork 2
185 lines (148 loc) · 5.56 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
175
176
177
178
179
180
181
182
183
184
185
name: Test
on:
push:
tags:
- '**'
branches:
- 1.x
pull_request:
branches:
- 1.x
jobs:
test:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- name: test-php-8.2-d10-legacy
php-version: 8.2
drupal-version: 10.2
- name: test-php-8.2-d10-stable
php-version: 8.2
drupal-version: 10.3
- name: test-php-8.2-d10-canary
php-version: 8.2
drupal-version: 10.4@beta
stability: canary
- name: test-php-8.3-d10-legacy
php-version: 8.3
drupal-version: 10.2
- name: test-php-8.3-d10-stable
php-version: 8.3
drupal-version: 10.3
- name: test-php-8.3-d10-canary
php-version: 8.3
drupal-version: 10.4@beta
stability: canary
- name: test-php-8.4-d10-legacy
php-version: 8.4
drupal-version: 10.3 # Lowest Drupal version that supports PHP 8.4.
- name: test-php-8.4-d10-stable
php-version: 8.4
drupal-version: 10.3
- name: test-php-8.4-d10-canary
php-version: 8.4
drupal-version: 10.4@beta
- name: test-php-8.3-d11-legacy
php-version: 8.3
drupal-version: 11.0 # Lowest Drupal version that exists.
- name: test-php-8.3-d11-stable
php-version: 8.3
drupal-version: 11.0
- name: test-php-8.3-d11-canary
php-version: 8.3
drupal-version: 11@beta
- name: test-php-8.4-d11-legacy
php-version: 8.4
drupal-version: 11.0 # Lowest Drupal version that exists.
- name: test-php-8.4-d11-stable
php-version: 8.4
drupal-version: 11.0
- name: test-php-8.4-d11-canary
php-version: 8.4
drupal-version: 11@beta
name: ${{ matrix.name }}
env:
DRUPAL_VERSION: ${{ matrix.drupal-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Upgrade sqlite3
run: |
wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz -O /tmp/sqlite.tar.gz
tar -xzf /tmp/sqlite.tar.gz -C /tmp
cd /tmp/sqlite-autoconf-3450300
./configure CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" --prefix=/usr/local
make && sudo make install
sudo ldconfig
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: gd, sqlite, pdo_sqlite
coverage: pcov
# Disable Symfony deprecations helper for PHP 8.4+ until minor
# versions of Drupal 10 and 11 fully support PHP 8.4.
# @see https://www.drupal.org/project/drupal/issues/1267246
- name: Update SYMFONY_DEPRECATIONS_HELPER for PHP 8.4
run: |
if [ "$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;')" == "84" ]; then
echo "SYMFONY_DEPRECATIONS_HELPER=disabled" >> "$GITHUB_ENV"
fi
- name: Assemble the codebase
run: .devtools/assemble.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Start built-in PHP server
run: .devtools/start.sh
- name: Provision site
run: .devtools/provision.sh
- name: Lint code with PHPCS
working-directory: build
run: vendor/bin/phpcs || [ "${CI_PHPCS_IGNORE_FAILURE:-0}" -eq 1 ]
- name: Lint code with PHPStan
working-directory: build
run: vendor/bin/phpstan || [ "${CI_PHPSTAN_IGNORE_FAILURE:-0}" -eq 1 ]
continue-on-error: ${{ endsWith(matrix.name, 'canary') }} # PHPStan levels for canary releases are not the same as for this project.
- name: Lint code with Rector
working-directory: build
run: vendor/bin/rector --clear-cache --dry-run || [ "${CI_RECTOR_IGNORE_FAILURE:-0}" -eq 1 ]
- name: Lint code with PHPMD
working-directory: build
run: vendor/bin/phpmd . text phpmd.xml || [ "${CI_PHPMD_IGNORE_FAILURE:-0}" -eq 1 ]
- name: Lint code with Twig CS Fixer
working-directory: build
run: vendor/bin/twig-cs-fixer || [ "${CI_TWIGCSFIXER_IGNORE_FAILURE:-0}" -eq 1 ]
- name: Run tests
working-directory: build
run: php -d pcov.directory=.. vendor/bin/phpunit || [ "${CI_TEST_IGNORE_FAILURE:-0}" -eq 1 ]
env:
BROWSERTEST_OUTPUT_DIRECTORY: /tmp
- name: Upload test results as an artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: Artifacts (${{ matrix.name }})
path: build/web/sites/simpletest/browser_output
- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-code-coverage-report-${{ matrix.name }}
path: ./.logs/coverage/phpunit/.coverage-html
include-hidden-files: true
if-no-files-found: error
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v5
if: ${{ env.CODECOV_TOKEN != '' }}
with:
files: ./.logs/coverage/phpunit/cobertura.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}