mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Test arm runner
This commit is contained in:
parent
a940200164
commit
01d3cb4b11
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
@ -176,16 +176,16 @@ jobs:
|
|||||||
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
|
||||||
- name: "Run Build Tests (doctor)"
|
- name: "Run Build Tests (doctor)"
|
||||||
run: bin/spc doctor --auto-fix --debug
|
run: php src/globals/test-extensions.php doctor_cmd ${{ matrix.os }} ${{ matrix.php }}
|
||||||
|
|
||||||
- name: "Prepare UPX for Windows"
|
- name: "Prepare UPX for Windows"
|
||||||
if: matrix.os == 'windows-latest'
|
if: ${{ startsWith(matrix.os, 'windows-') }}
|
||||||
run: |
|
run: |
|
||||||
bin/spc install-pkg upx
|
bin/spc install-pkg upx
|
||||||
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $env:GITHUB_ENV
|
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
- name: "Prepare UPX for Linux"
|
- name: "Prepare UPX for Linux"
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
|
||||||
run: |
|
run: |
|
||||||
bin/spc install-pkg upx
|
bin/spc install-pkg upx
|
||||||
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV
|
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV
|
||||||
|
|||||||
@ -24,7 +24,9 @@ $test_os = [
|
|||||||
// 'macos-13',
|
// 'macos-13',
|
||||||
// 'macos-14',
|
// 'macos-14',
|
||||||
'ubuntu-latest',
|
'ubuntu-latest',
|
||||||
'windows-latest',
|
'ubuntu-22.04',
|
||||||
|
'ubuntu-22.04-arm',
|
||||||
|
'ubuntu-24.04-arm',
|
||||||
];
|
];
|
||||||
|
|
||||||
// whether enable thread safe
|
// whether enable thread safe
|
||||||
@ -115,6 +117,10 @@ if ($argv[1] === 'download_cmd') {
|
|||||||
$down_cmd .= $prefer_pre_built ? '--prefer-pre-built ' : '';
|
$down_cmd .= $prefer_pre_built ? '--prefer-pre-built ' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($argv[1] === 'doctor_cmd') {
|
||||||
|
$doctor_cmd = 'doctor --auto-fix --debug';
|
||||||
|
}
|
||||||
|
|
||||||
// generate build command
|
// generate build command
|
||||||
if ($argv[1] === 'build_cmd' || $argv[1] === 'build_embed_cmd') {
|
if ($argv[1] === 'build_cmd' || $argv[1] === 'build_embed_cmd') {
|
||||||
$build_cmd = 'build ';
|
$build_cmd = 'build ';
|
||||||
@ -139,30 +145,33 @@ echo match ($argv[1]) {
|
|||||||
'upx' => $upx ? '--with-upx-pack' : '',
|
'upx' => $upx ? '--with-upx-pack' : '',
|
||||||
'prefer_pre_built' => $prefer_pre_built ? '--prefer-pre-built' : '',
|
'prefer_pre_built' => $prefer_pre_built ? '--prefer-pre-built' : '',
|
||||||
'download_cmd' => $down_cmd,
|
'download_cmd' => $down_cmd,
|
||||||
|
'doctor_cmd' => $doctor_cmd,
|
||||||
'build_cmd' => $build_cmd,
|
'build_cmd' => $build_cmd,
|
||||||
'build_embed_cmd' => $build_cmd,
|
'build_embed_cmd' => $build_cmd,
|
||||||
default => '',
|
default => '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$prefix = match ($argv[2]) {
|
||||||
|
'windows-latest', 'windows-2022', 'windows-2019', 'windows-2025' => 'powershell.exe -file .\bin\spc.ps1 ',
|
||||||
|
'ubuntu-latest', 'ubuntu-24.04', 'ubuntu-24.04-arm' => './bin/spc ',
|
||||||
|
'ubuntu-22.04', 'ubuntu-22.04-arm' => 'bin/spc-gnu-docker ',
|
||||||
|
'ubuntu-20.04' => 'bin/spc-alpine-docker ',
|
||||||
|
default => 'bin/spc ',
|
||||||
|
};
|
||||||
|
|
||||||
if ($argv[1] === 'download_cmd') {
|
if ($argv[1] === 'download_cmd') {
|
||||||
if (str_starts_with($argv[2], 'windows-')) {
|
passthru($prefix . $down_cmd, $retcode);
|
||||||
passthru('powershell.exe -file .\bin\spc.ps1 ' . $down_cmd, $retcode);
|
|
||||||
} else {
|
|
||||||
passthru('./bin/spc ' . $down_cmd, $retcode);
|
|
||||||
}
|
|
||||||
} elseif ($argv[1] === 'build_cmd') {
|
} elseif ($argv[1] === 'build_cmd') {
|
||||||
if (str_starts_with($argv[2], 'windows-')) {
|
passthru($prefix . $build_cmd . ' --build-cli --build-micro', $retcode);
|
||||||
passthru('powershell.exe -file .\bin\spc.ps1 ' . $build_cmd . ' --build-cli --build-micro', $retcode);
|
|
||||||
} else {
|
|
||||||
passthru('./bin/spc ' . $build_cmd . ' --build-cli --build-micro', $retcode);
|
|
||||||
}
|
|
||||||
} elseif ($argv[1] === 'build_embed_cmd') {
|
} elseif ($argv[1] === 'build_embed_cmd') {
|
||||||
if (str_starts_with($argv[2], 'windows-')) {
|
if (str_starts_with($argv[2], 'windows-')) {
|
||||||
// windows does not accept embed SAPI
|
// windows does not accept embed SAPI
|
||||||
passthru('powershell.exe -file .\bin\spc.ps1 ' . $build_cmd . ' --build-cli', $retcode);
|
passthru($prefix . $build_cmd . ' --build-cli', $retcode);
|
||||||
} else {
|
} else {
|
||||||
passthru('./bin/spc ' . $build_cmd . ' --build-embed', $retcode);
|
passthru($prefix . $build_cmd . ' --build-embed', $retcode);
|
||||||
}
|
}
|
||||||
|
} elseif ($argv[1] === 'doctor_cmd') {
|
||||||
|
passthru($prefix . $doctor_cmd, $retcode);
|
||||||
} else {
|
} else {
|
||||||
$retcode = 0;
|
$retcode = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user