-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (124 loc) · 4.5 KB
/
Copy pathci.yml
File metadata and controls
146 lines (124 loc) · 4.5 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
140
141
142
143
144
145
146
# CI workflow for Manifold
# Satisfies: B2 (release velocity), RT-5 (CI integration)
#
# Security scanning runs as a separate workflow (security.yml) which
# triggers on the same events. Use branch protection rules to require
# security checks to pass before merging.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# Run Manifold verification
manifold:
name: Verify Manifolds
uses: ./.github/workflows/manifold-verify.yml
with:
fail-on-gaps: false # Set to true to fail on non-blocking gaps
# Static quality gate: formatting, linting (Biome) and typecheck all block.
quality:
name: Format, Lint & Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Check formatting
run: bun run format:check
- name: Lint
run: bun run lint
- name: Typecheck
run: bun run typecheck
# Run tests
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run tests with coverage
run: |
# RT-2: Run tests with coverage reporting
# TN2 resolution: warning-only until coverage tool validated
bun test --coverage 2>&1 | tee /tmp/coverage-output.txt
# Extract coverage percentage for summary
COVERAGE=$(grep -oP 'All files\s*\|\s*\K[0-9.]+' /tmp/coverage-output.txt 2>/dev/null || echo "unknown")
echo "## Test Coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Line Coverage | ${COVERAGE}% |" >> $GITHUB_STEP_SUMMARY
echo "| Threshold | 70% (warning-only) |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# TN2: Warning-only for now -- flip to enforcing after T7 validation
if [ "$COVERAGE" != "unknown" ]; then
COVERAGE_INT=${COVERAGE%.*}
if [ "$COVERAGE_INT" -lt 70 ] 2>/dev/null; then
echo "::warning::Test coverage (${COVERAGE}%) is below 70% threshold"
echo "⚠️ Coverage below threshold. See TN2 resolution for enforcement timeline." >> $GITHUB_STEP_SUMMARY
else
echo "✅ Coverage meets threshold." >> $GITHUB_STEP_SUMMARY
fi
fi
# Verify Windows compilation
# Satisfies: T9 (Windows binary), G2 (Windows CI verification)
windows-build:
name: Windows Build Check
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Compile Windows binary
working-directory: cli
run: |
bun build ./index.ts --compile --target=bun-windows-x64 --outfile ./dist/manifold-windows-x64.exe
- name: Test Windows binary
working-directory: cli
shell: pwsh
run: |
Write-Host "Testing compiled binary..."
& ./dist/manifold-windows-x64.exe --version
& ./dist/manifold-windows-x64.exe --help
& ./dist/manifold-windows-x64.exe hook --help
Write-Host "Windows binary verified!"
- name: Test PowerShell scripts syntax
shell: pwsh
run: |
$errors = @()
foreach ($script in @("plugin/bin/install-cli.ps1", "plugin/hooks/session-start.ps1")) {
$tokens = $null
$parseErrors = $null
[System.Management.Automation.PSParser]::Tokenize((Get-Content $script -Raw), [ref]$parseErrors) | Out-Null
if ($parseErrors.Count -gt 0) {
$errors += "$script has $($parseErrors.Count) parse errors"
} else {
Write-Host " $script - syntax OK"
}
}
if ($errors.Count -gt 0) {
$errors | ForEach-Object { Write-Error $_ }
exit 1
}
Write-Host "All PowerShell scripts validated!"