Repository navigation
80 lines (69 loc) · 3.21 KB
/
Copy pathtests.yml
File metadata and controls
80 lines (69 loc) · 3.21 KB
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
name: Tests
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
php:
description: 'PHP version (blank = all)'
required: false
type: choice
options: ['', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
# the jobs only read the code
permissions:
contents: read
jobs:
test:
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
# 8.6 is prerelease: report its result but never fail the build; drop this when 8.6 ships
continue-on-error: ${{ matrix.php == '8.6' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ${{ inputs.php && fromJSON(format('["{0}"]', inputs.php)) || fromJSON('["8.1","8.2","8.3","8.4","8.5","8.6"]') }}
include:
# OS/arch bugs (paths, case-insensitive filenames, char signedness in
# extensions) don't vary by PHP version, so one job per platform at the
# 8.1 floor. No Windows ARM job: php.net ships no ARM64 Windows builds.
- { os: windows-latest, php: '8.1' } # Windows x64 - where the CMS runs in production
- { os: ubuntu-24.04-arm, php: '8.1' } # Linux arm64 - Graviton-class hosts
- { os: macos-latest, php: '8.1' } # macOS arm64 - Apple Silicon devs
# macos-15-intel is off: setup-php often can't install PHP 8.1 there and the job fails before any test runs
# - { os: macos-15-intel, php: '8.1' } # macOS x64 - Intel Macs
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false # no step uses git with the token, so don't leave it in .git/config
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
timeout-minutes: 5 # takes under 3 min; setup-php can hang on macOS
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
# LocaleTest needs a locale where /i stops matching I to i, and TokenizerTest a single-byte one; both skip without.
# locale-gen only takes the names in /usr/share/i18n/SUPPORTED, where the Latin-1 German locale is plain de_DE,
# so localedef builds it under the name the test asks for
- name: Install Turkish and German locales
if: runner.os == 'Linux'
run: |
sudo locale-gen tr_TR.UTF-8
sudo localedef -i de_DE -f ISO-8859-1 de_DE.ISO-8859-1
- name: Run tests
run: vendor/bin/phpunit --colors=always
# The PCRE interpreter counts pcre.backtrack_limit differently from the JIT and reaches it on far
# smaller input. Hosts run it without choosing to (SELinux with executable memory denied, a PCRE
# built without JIT). The count is PCRE's, not PHP's, so one job at the 8.1 floor covers it
- name: Run tests with the PCRE JIT off
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.1'
run: php -d pcre.jit=0 vendor/bin/phpunit --colors=always