-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.99 KB
/
Test.yml
File metadata and controls
62 lines (50 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Test
on:
workflow_dispatch:
jobs:
run:
runs-on: windows-latest
timeout-minutes: 80
steps:
# -------------------------------------------------
- name: 1. 拉取仓库
uses: actions/checkout@v4
# -------------------------------------------------
- name: 2. 运行 CLI(强检路径 + 验证输出)
id: run_exe
shell: pwsh
timeout-minutes: 70
run: |
# --- 明确 EXE 完整路径(基于 workspace) ---
$exeDir = Join-Path $env:GITHUB_WORKSPACE "HiddifyConfigsCLI/bin/Debug/net9.0"
$exe = Join-Path $exeDir "HiddifyConfigsCLI.exe"
Write-Host "预期 EXE Dir = $exeDir"
Write-Host "预期 EXE Path = $exe"
if (!(Test-Path $exe)) {
Write-Error "EXE 不存在: $exe"
exit 1
}
# 输入 URL(可按需替换)
$input = "https://raw.githubusercontent.com/shinexus/LearnToProgram/refs/heads/master/HiddifyConfigsCLI/config/test_url.txt"
# 输出 绝对路径
$outputFile = Join-Path $exeDir "_test.txt"
# 参数数组
$params = @(
"--input", $input,
"--output", $outputFile,
"--max-lines", "100",
"--max-parts", "2",
"--timeout", "6",
"--parallel", "128",
"--http-timeout", "5"
"--verbose"
)
# --- 用 Start-Process 确保 WorkingDirectory 不被重置,拿到进程对象以读取 ExitCode ---
Write-Host "使用 Start-Process 启动 EXE..."
$proc = Start-Process -FilePath $exe -WorkingDirectory $exeDir -ArgumentList $params -Wait -NoNewWindow -PassThru
Write-Host "Start-Process 返回 ExitCode: $($proc.ExitCode)"
if ($proc.ExitCode -ne 0) {
Write-Error "CLI 退出码非0: $($proc.ExitCode)"
exit $proc.ExitCode
}
Write-Host "Step 2 完成"