Repository navigation
64 lines (52 loc) · 2.13 KB
/
Copy pathperformance-tests.yml
File metadata and controls
64 lines (52 loc) · 2.13 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
name: PHP Performance Tests
on:
workflow_dispatch:
permissions:
contents: read
jobs:
run:
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php-version: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
name: PHP ${{ matrix.php-version }} performance test on ${{ matrix.operating-system }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install PHP
id: php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
# Keep JIT enabled while avoiding the function-JIT crash in PHPUnit's exporter (#92).
ini-values: opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=256M
- name: Check PHP version
run: php -v
- name: Verify OPcache and tracing JIT
run: |
php -r '
$status = opcache_get_status(false);
$jit = $status["jit"] ?? [];
echo json_encode(["opcache_enabled" => $status["opcache_enabled"] ?? false, "jit" => $jit], JSON_PRETTY_PRINT), PHP_EOL;
if (!($status["opcache_enabled"] ?? false) || !($jit["enabled"] ?? false) || !($jit["on"] ?? false) || ($jit["kind"] ?? null) !== 5) {
fwrite(STDERR, "Expected OPcache and tracing JIT to be enabled.\n");
exit(1);
}
'
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.operating-system }}-php-${{ steps.php.outputs.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-${{ matrix.operating-system }}-php-${{ steps.php.outputs.php-version }}
- if: steps.composer-cache.outputs.cache-hit != 'true'
name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
- name: PHPUnit Performance Tests
run: vendor/bin/phpunit --testsuite=Performance --display-notices