Skip to content

Commit bfbed95

Browse files
committed
Improve
1 parent d8e6ee1 commit bfbed95

File tree

3 files changed

+51
-15
lines changed

3 files changed

+51
-15
lines changed

.github/nightly.php

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3+
putenv("ASAN_OPTIONS=exitcode=139");
4+
putenv("SYMFONY_DEPRECATIONS_HELPER=max[total]=999");
5+
putenv("PHPSECLIB_ALLOW_JIT=1");
6+
37
function printMutex(string $result): void {
48
flock(STDOUT, LOCK_EX);
59
fwrite(STDOUT, $result.PHP_EOL);
@@ -129,13 +133,17 @@ function (): iterable {
129133
}
130134
};
131135

136+
$waitAll = function () use ($waitOne, &$parentPids): void {
137+
while ($parentPids) {
138+
$waitOne();
139+
}
140+
};
141+
142+
132143
foreach ($repos as $dir => [$repo, $branch, $prepare, $command, $repeat]) {
133144
$pid = pcntl_fork();
134145
if ($pid) {
135146
$parentPids[$pid] = true;
136-
if (count($parentPids) >= $parallel) {
137-
$waitOne();
138-
}
139147
continue;
140148
}
141149

@@ -144,7 +152,21 @@ function (): iterable {
144152
$branch = "--branch $branch";
145153
}
146154
e("git clone $repo $branch --depth 1 $dir");
147-
chdir($dir);
155+
}
156+
157+
$waitAll();
158+
159+
foreach ($repos as $dir => [$repo, $branch, $prepare, $command, $repeat]) {
160+
$pid = pcntl_fork();
161+
if ($pid) {
162+
$parentPids[$pid] = true;
163+
if (count($parentPids) >= $parallel) {
164+
$waitOne();
165+
}
166+
continue;
167+
}
168+
169+
chdir(sys_get_temp_dir()."/$dir");
148170
$rev = e("git rev-parse HEAD");
149171
e("composer i --ignore-platform-reqs", $dir);
150172
if ($prepare) {
@@ -196,8 +218,6 @@ function (): iterable {
196218
exit($final);
197219
}
198220

199-
while ($parentPids) {
200-
$waitOne();
201-
}
221+
$waitAll();
202222

203223
die($finalStatus);

.github/workflows/nightly.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,6 @@ jobs:
387387
- name: Test multiple libraries and frameworks in parallel
388388
if: matrix.branch.ref != 'PHP-8.0'
389389
run: |
390-
export ASAN_OPTIONS=exitcode=139
391-
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
392-
export PHPSECLIB_ALLOW_JIT=1
393-
394390
php $GITHUB_WORKSPACE/.github/nightly.php || exit $?
395391
396392
- name: Test Psalm

.github/workflows/push.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,32 @@ jobs:
124124
if: ${{ !matrix.asan }}
125125
uses: ./.github/actions/setup-x64
126126

127-
- name: Test multiple libraries and frameworks in parallel
127+
- name: Enable Opcache and JIT
128128
run: |
129-
export ASAN_OPTIONS=exitcode=139
130-
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
131-
export PHPSECLIB_ALLOW_JIT=1
129+
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
130+
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
131+
echo opcache.enable=1 >> /etc/php.d/opcache.ini
132+
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
133+
echo opcache.jit=tracing >> /etc/php.d/opcache.ini
134+
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
135+
echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini
136+
echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini
137+
echo opcache.jit_max_exit_counters=100000 >> /etc/php.d/opcache.ini
138+
echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini
139+
echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini
140+
echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini
141+
echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini
142+
echo opcache.jit_blacklist_root_trace=255 >> /etc/php.d/opcache.ini
143+
echo opcache.jit_blacklist_side_trace=255 >> /etc/php.d/opcache.ini
144+
echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini
145+
echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini
146+
echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini
147+
echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini
148+
echo memory_limit=-1 >> /etc/php.d/opcache.ini
149+
php -v
132150
151+
- name: Test multiple libraries and frameworks in parallel
152+
run: |
133153
php $GITHUB_WORKSPACE/.github/nightly.php || exit $?
134154
135155
- name: Test

0 commit comments

Comments
 (0)