mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add optional workflow (#548)
* Add optional workflow * Add optional workflow
This commit is contained in:
parent
5383cf7c25
commit
b62963489a
37
.github/workflows/tests.yml
vendored
37
.github/workflows/tests.yml
vendored
@ -111,22 +111,39 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
vendor/bin/phpunit tests/ --no-coverage
|
vendor/bin/phpunit tests/ --no-coverage
|
||||||
|
|
||||||
|
define-matrix:
|
||||||
|
name: "Define Matrix"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
php: ${{ steps.gendef.outputs.php }}
|
||||||
|
os: ${{ steps.gendef.outputs.os }}
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: "Setup PHP"
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: 8.2
|
||||||
|
|
||||||
|
- name: Define
|
||||||
|
id: gendef
|
||||||
|
run: |
|
||||||
|
PHP_VERSIONS=$(php src/globals/test-extensions.php php)
|
||||||
|
OS_VERSIONS=$(php src/globals/test-extensions.php os)
|
||||||
|
echo 'php='"$PHP_VERSIONS" >> "$GITHUB_OUTPUT"
|
||||||
|
echo 'os='"$OS_VERSIONS" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
|
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: define-matrix
|
||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php:
|
php: ${{ fromJSON(needs.define-matrix.outputs.php) }}
|
||||||
- "8.0"
|
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
|
||||||
- "8.1"
|
|
||||||
- "8.2"
|
|
||||||
- "8.3"
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- macos-13
|
|
||||||
- windows-latest
|
|
||||||
- macos-14
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
|
|||||||
@ -11,6 +11,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
// --------------------------------- edit area ---------------------------------
|
// --------------------------------- edit area ---------------------------------
|
||||||
|
|
||||||
|
$test_php_version = ['8.3'];
|
||||||
|
|
||||||
|
$test_os = ['macos-13', 'macos-14', 'ubuntu-latest', 'windows-latest'];
|
||||||
|
|
||||||
$zts = false;
|
$zts = false;
|
||||||
|
|
||||||
$no_strip = false;
|
$no_strip = false;
|
||||||
@ -58,7 +62,7 @@ function _getCombination(string $type = 'common'): string
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($argv[1])) {
|
if (!isset($argv[1])) {
|
||||||
exit("Please use 'extensions', 'cmd' or 'libs' as output type");
|
exit("Please use 'extensions', 'cmd', 'os', 'php' or 'libs' as output type");
|
||||||
}
|
}
|
||||||
|
|
||||||
$trim_value = "\r\n \t,";
|
$trim_value = "\r\n \t,";
|
||||||
@ -73,6 +77,8 @@ if (PHP_OS_FAMILY === 'Windows') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo match ($argv[1]) {
|
echo match ($argv[1]) {
|
||||||
|
'os' => json_encode($test_os),
|
||||||
|
'php' => json_encode($test_php_version),
|
||||||
'extensions' => $final_extensions,
|
'extensions' => $final_extensions,
|
||||||
'libs' => $final_libs,
|
'libs' => $final_libs,
|
||||||
'libs_cmd' => ($final_libs === '' ? '' : (' --with-libs=' . $final_libs)),
|
'libs_cmd' => ($final_libs === '' ? '' : (' --with-libs=' . $final_libs)),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user