Repository navigation
139 lines (124 loc) · 5.52 KB
/
Copy pathci.yml
File metadata and controls
139 lines (124 loc) · 5.52 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Cross-Platform CI
on:
push:
branches: [main, 'feature/**', 'feature/*']
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
name: Test on ${{ matrix.os }} (Node ${{ matrix.node-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
node-version: ['22.x', '24.x']
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Verify Environment
run: |
node -v
npm -v
- name: Install Dependencies
shell: bash
run: |
npm ci 2>&1 | tee npm-ci.log || {
cat npm-ci.log
exit 1
}
- name: Build Frontend Application
run: npm run build:frontend
- name: Provision Xray-core
run: npm run provision:xray
- name: Run Cross-Platform Platform Tests
shell: bash
run: |
npx tsx tests/platform-tests.ts 2>&1 | tee platform-tests.log || {
echo "::error::$(tail -n 5 platform-tests.log | tr '\n' ' ')"
echo "### Platform Tests Failure Log" >> "$GITHUB_STEP_SUMMARY"
echo '```text' >> "$GITHUB_STEP_SUMMARY"
cat platform-tests.log >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
exit 1
}
- name: Run Acceptance & Security Test Scenarios
shell: bash
run: |
npm test 2>&1 | tee test-scenarios.log || {
echo "::error::$(tail -n 10 test-scenarios.log | tr '\n' ' ')"
echo "### Test Scenarios Failure Log" >> "$GITHUB_STEP_SUMMARY"
echo '```text' >> "$GITHUB_STEP_SUMMARY"
cat test-scenarios.log >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
exit 1
}
- name: Run High-Speed Pipeline Tests
shell: bash
run: |
npx tsx tests/pipeline-speed-tests.ts 2>&1 | tee pipeline-speed.log || {
echo "::error::$(tail -n 10 pipeline-speed.log | tr '\n' ' ')"
exit 1
}
- name: Build Documentation
run: npm run docs:build
- name: Build Native Windows Launcher & Verify Arguments (Windows Only)
if: runner.os == 'Windows'
shell: bash
run: |
powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/windows/build-launcher.ps1 -Strict 2>&1 | tee build-launcher.log || {
while IFS= read -r line; do
echo "::error::$line"
done < build-launcher.log
exit 1
}
if [ ! -f "bin/opencode-vpn.exe" ]; then
echo "::error::bin/opencode-vpn.exe was not created"
exit 1
fi
echo "Native launcher compiled successfully."
- name: Verify Windows Scripts & Packaging (Windows Only)
if: runner.os == 'Windows'
shell: bash
run: |
powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/windows/check-environment.ps1
npm run package:portable
powershell.exe -NoProfile -Command "
\$pkg = Get-ChildItem dist-release/*.zip | Select-Object -First 1
if (-not \$pkg) { throw 'Portable package not found' }
\$testExtractDir = Join-Path \$env:TEMP 'ocr-portable-verify'
if (Test-Path \$testExtractDir) { Remove-Item -Recurse -Force \$testExtractDir }
Expand-Archive -Path \$pkg.FullName -DestinationPath \$testExtractDir
if (-not (Test-Path \"\$testExtractDir/Start-Router.bat\")) { throw 'Start-Router.bat missing from package' }
if (-not (Test-Path \"\$testExtractDir/bin/opencode-vpn.exe\")) { throw 'bin/opencode-vpn.exe missing from Windows package' }
if (-not (Test-Path \"\$testExtractDir/bin/opencode-vpn.cmd\")) { throw 'bin/opencode-vpn.cmd missing' }
if (-not (Test-Path \"\$testExtractDir/bin/opencode-vpn.ps1\")) { throw 'bin/opencode-vpn.ps1 missing' }
Get-ChildItem -Path \$testExtractDir -Recurse -Filter *.ps1 | ForEach-Object {
\$toks = \$null; \$errs = \$null
[System.Management.Automation.Language.Parser]::ParseFile(\$_.FullName, [ref]\$toks, [ref]\$errs)
if (\$errs -and \$errs.Count -gt 0) { throw ('AST parse error in packaged ' + \$_.Name + ': ' + (\$errs | Out-String)) }
}
Get-ChildItem -Recurse -Filter *.ps1 | ForEach-Object {
\$toks = \$null; \$errs = \$null
[System.Management.Automation.Language.Parser]::ParseFile(\$_.FullName, [ref]\$toks, [ref]\$errs)
if (\$errs -and \$errs.Count -gt 0) { throw ('AST parse error in repo ' + \$_.Name + ': ' + (\$errs | Out-String)) }
}
"
echo "Portable package verified and extracted cleanly."
- name: Run Native Windows Release Verification Kit (Windows Only)
if: runner.os == 'Windows'
shell: bash
run: |
powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/windows/verify-release.ps1 2>&1 | tee verify-release.log || {
while IFS= read -r line; do
echo "::error::$line"
done < verify-release.log
exit 1
}
echo "Native Windows verification kit passed."
echo "NOTE: Windows ARM64 target matrix remains IMPLEMENTED BUT UNVERIFIED on real ARM64 hardware."