Skip to content

Commit cc70c66

Browse files
committed
wip
1 parent 9ac198b commit cc70c66

File tree

5 files changed

+127
-16
lines changed

5 files changed

+127
-16
lines changed

.github/actions/test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
export REPORT_EXIT_STATUS=no
2525
export SKIP_IO_CAPTURE_TESTS=1
2626
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
27-
-j$(/usr/bin/nproc) \
27+
-j$(${{ env.ARCH != 'macos' && '/usr/bin/nproc' || 'sysctl -n hw.logicalcpu' }}) \
2828
-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
2929
--offline \
3030
--show-diff \

.github/actions/tests/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ runs:
1414
- name: Tracing JIT
1515
uses: ./.github/actions/test
1616
with:
17-
runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M'
17+
runTestsParameters: "${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M"
1818
- name: OpCache
1919
if: ${{ inputs.extended }}
2020
uses: ./.github/actions/test
2121
with:
22-
runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }}'
22+
runTestsParameters: "${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }}"
2323
- name: Function JIT
2424
if: ${{ inputs.extended }}
2525
uses: ./.github/actions/test
2626
with:
27-
runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M -d opcache.jit=1205'
27+
runTestsParameters: "${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M -d opcache.jit=1205"

.github/nightly_matrix.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
const BRANCHES = ['master', 'PHP-8.1', 'PHP-8.0', 'PHP-7.4'];
4+
const ARCHES = ['linux-x64', 'linux-i386', 'macos'];
5+
6+
function get_branches() {
7+
// FIXME: Check if branch has changed in the last 24 hours
8+
// return ['master', 'PHP-8.1', 'PHP-8.0', 'PHP-7.4'];
9+
return ['master'];
10+
11+
return array_filter(BRANCHES, function ($branch) {
12+
return shell_exec('git rev-list --after="24 hours" origin/' . $branch) !== null;
13+
});
14+
}
15+
16+
function get_matrix() {
17+
$result = [];
18+
19+
foreach (get_branches() as $branch) {
20+
foreach (ARCHES as $arch) {
21+
foreach ([true, false] as $debug) {
22+
foreach ([true, false] as $zts) {
23+
$branch_key = strtoupper(str_replace('.', '', $branch));
24+
$arch_key = strtoupper($arch);
25+
$debug_key = $debug ? 'DEBUG' : 'RELEASE';
26+
$zts_key = $zts ? 'ZTS' : 'NTS';
27+
$name = "{$branch_key}_{$arch_key}_{$debug_key}_{$zts_key}";
28+
29+
$debug_parameter = $debug ? '--enable-debug' : '--disable-debug';
30+
$zts_parameter = $debug ? '--enable-zts' : '--disable-zts';
31+
$configuration_parameters = "$debug_parameter $zts_parameter";
32+
33+
$result[] = [
34+
'name' => $name,
35+
'branch' => $branch,
36+
'arch' => $arch,
37+
'configurationParameters' => $configuration_parameters,
38+
];
39+
}
40+
}
41+
}
42+
}
43+
44+
return ['include' => $result];
45+
}
46+
47+
echo '::set-output name=matrix::' . json_encode(get_matrix(), JSON_UNESCAPED_SLASHES) . "\n";

.github/workflows/nightly.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Nightly
2+
# Update to only run on a schedule
3+
on:
4+
push:
5+
ignore-paths:
6+
- docs/*
7+
- NEWS
8+
- UPGRADING
9+
- UPGRADING.INTERNALS
10+
- README.md
11+
- CONTRIBUTING.md
12+
- CODING_STANDARDS.md
13+
jobs:
14+
generate-matrix:
15+
name: Generate Build Matrix
16+
runs-on: ubuntu-latest
17+
outputs:
18+
matrix: ${{ steps.set-matrix.outputs.matrix }}
19+
steps:
20+
- uses: actions/checkout@v2
21+
with:
22+
depth: 0
23+
- name: Generate Build Matrix
24+
id: set-matrix
25+
run: php .github/nightly_matrix.php
26+
test:
27+
needs: generate-matrix
28+
strategy:
29+
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
30+
fail-fast: false
31+
name: ${{ matrix.name }}
32+
runs-on: ${{ startsWith(matrix['arch'], 'linux-') && 'ubuntu-20.04' || 'macOS-10.15' }}
33+
env:
34+
ARCH: ${{ matrix.arch }}
35+
steps:
36+
- name: git checkout
37+
uses: actions/checkout@v2
38+
# Only test on current branch until merged
39+
# with:
40+
# ref: ${{ matrix.branch }}
41+
- name: Create mssql container
42+
if: ${{ env.ARCH != 'macos' }}
43+
uses: ./.github/actions/mssql
44+
- name: Install dependencies
45+
uses: ./.github/actions/deps
46+
- name: ./configure
47+
uses: ./.github/actions/configure
48+
with:
49+
configurationParameters: ${{ matrix.configurationParameters }}
50+
- name: make
51+
shell: bash
52+
run: |
53+
if [ "$ARCH" == "macos" ]; then
54+
export PATH="/usr/local/opt/bison/bin:$PATH"
55+
fi
56+
make -j$(${{ env.ARCH != 'macos' && '/usr/bin/nproc' || 'sysctl -n hw.logicalcpu' }}) >/dev/null
57+
- name: make install
58+
uses: ./.github/actions/install
59+
- name: Setup
60+
if: ${{ env.ARCH != 'macos' }}
61+
uses: ./.github/actions/setup
62+
- name: Test
63+
uses: ./.github/actions/tests
64+
with:
65+
extended: ${{ inputs.extendedTests }}

.github/workflows/push.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,37 @@ name: Push
22
on:
33
push:
44
ignore-paths:
5-
- docs/*
6-
- NEWS
7-
- UPGRADING
8-
- UPGRADING.INTERNALS
9-
- README.md
10-
- CONTRIBUTING.md
11-
- CODING_STANDARDS.md
5+
- docs/*
6+
- NEWS
7+
- UPGRADING
8+
- UPGRADING.INTERNALS
9+
- README.md
10+
- CONTRIBUTING.md
11+
- CODING_STANDARDS.md
12+
# Ignore while testing nightly
13+
branches-ignore:
14+
- '**'
1215
jobs:
1316
test:
1417
strategy:
1518
matrix:
1619
include:
1720
- name: LINUX_X64_DEBUG_NTS
1821
arch: linux-x64
19-
runs-on: ubuntu-20.04
2022
configurationParameters: --enable-debug --disable-zts
2123
- name: LINUX_X64_RELEASE_ZTS
2224
arch: linux-x64
23-
runs-on: ubuntu-20.04
2425
configurationParameters: --disable-debug --enable-zts
2526
# apt broken, not sure why
2627
# - name: LINUX_I386_DEBUG_ZTS
2728
# arch: linux-i386
28-
# runs-on: ubuntu-20.04
2929
# configurationParameters: --enable-debug --disable-zts
3030
- name: MACOS_DEBUG_NTS
3131
arch: macos
32-
runs-on: macOS-10.15
3332
configurationParameters: --enable-debug --disable-zts
3433
fail-fast: false
3534
name: ${{ matrix.name }}
36-
runs-on: ${{ matrix['runs-on'] }}
35+
runs-on: ${{ startsWith(matrix['arch'], 'linux-') && 'ubuntu-20.04' || 'macOS-10.15' }}
3736
env:
3837
ARCH: ${{ matrix.arch }}
3938
steps:

0 commit comments

Comments
 (0)