Add upx cmd for tests

This commit is contained in:
crazywhalecc 2025-03-30 21:03:11 +08:00
parent 50cfc5899b
commit 23bd216cc7
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 8 additions and 2 deletions

View File

@ -181,13 +181,13 @@ jobs:
- name: "Prepare UPX for Windows" - name: "Prepare UPX for Windows"
if: ${{ startsWith(matrix.os, 'windows-') }} if: ${{ startsWith(matrix.os, 'windows-') }}
run: | run: |
bin/spc install-pkg upx php src/globals/test-extensions.php install_upx_cmd ${{ matrix.os }} ${{ matrix.php }}
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: ${{ startsWith(matrix.os, 'ubuntu-') }} if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: | run: |
bin/spc install-pkg upx php src/globals/test-extensions.php install_upx_cmd ${{ matrix.os }} ${{ matrix.php }}
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV
- name: "Run Build Tests (download)" - name: "Run Build Tests (download)"

View File

@ -120,6 +120,9 @@ if ($argv[1] === 'download_cmd') {
if ($argv[1] === 'doctor_cmd') { if ($argv[1] === 'doctor_cmd') {
$doctor_cmd = 'doctor --auto-fix --debug'; $doctor_cmd = 'doctor --auto-fix --debug';
} }
if ($argv[1] === 'install_upx_cmd') {
$install_upx_cmd = 'install-pkg upx';
}
// 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') {
@ -145,6 +148,7 @@ 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,
'install_upx_cmd' => $install_upx_cmd,
'doctor_cmd' => $doctor_cmd, 'doctor_cmd' => $doctor_cmd,
'build_cmd' => $build_cmd, 'build_cmd' => $build_cmd,
'build_embed_cmd' => $build_cmd, 'build_embed_cmd' => $build_cmd,
@ -172,6 +176,8 @@ if ($argv[1] === 'download_cmd') {
} }
} elseif ($argv[1] === 'doctor_cmd') { } elseif ($argv[1] === 'doctor_cmd') {
passthru($prefix . $doctor_cmd, $retcode); passthru($prefix . $doctor_cmd, $retcode);
} elseif ($argv[1] === 'install_upx_cmd') {
passthru($prefix . $install_upx_cmd, $retcode);
} else { } else {
$retcode = 0; $retcode = 0;
} }