فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

ci(a02): exercise all staging, verification, restore and SQL localdb gates together

davoodmehraban89 committed Oct 30, 2026 at 19:45 UTC ecc0ebe707b314ccf51857a25a3ac9f7d1f73d83
1 file changed +64
.github/workflows/pr-quality-gates.yml
+64
@@ -61,6 +61,70 @@ jobs:
61 run: npm ci
62 - name: Windows integration regression
63 run: npm test
64 + - name: A02 SQL backup preflight selftest (read-only; no SQL instance/data)
65 + shell: pwsh
66 + run: |
67 + $output = & powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File './scripts/a02-sql-backup-readonly-preflight.ps1' -SelfTest
68 + if ($LASTEXITCODE -ne 0) { throw 'A02 PowerShell selftest failed' }
69 + $result = ($output | Out-String | ConvertFrom-Json)
70 + if ($result.status -ne 'selftest-passed' -or $result.databaseModified -ne $false -or $result.canImport -ne $false -or $result.connectionOpened -ne $false) {
71 + throw 'A02 PowerShell selftest safety result invalid'
72 + }
73 + - name: Guarded SQL restore helper self-test (no SQL, no backup, zero writes)
74 + shell: pwsh
75 + run: |
76 + $result = & powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File './scripts/a02-isolated-sql-restore.ps1' -Mode Test
77 + if ($LASTEXITCODE -ne 0) { throw 'A02 isolated restore synthetic self-test failed' }
78 + $report = ($result | Out-String | ConvertFrom-Json)
79 + if ($report.status -ne 'selftest-passed' -or
80 + $report.sqlConnectionOpened -ne $false -or
81 + $report.backupOpened -ne $false -or
82 + $report.databaseModified -ne $false -or
83 + $report.canImport -ne $false) {
84 + throw 'A02 unsafe self-test result'
85 + }
86 + - name: Holoo ZIP private staging regression (synthetic only)
87 + shell: pwsh
88 + run: |
89 + $output = & powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File './scripts/a02-private-holoo-zip-staging.ps1' -Mode Test
90 + if ($LASTEXITCODE -ne 0) { throw 'A02 private ZIP staging selftest failed' }
91 + $report = ($output | Out-String | ConvertFrom-Json)
92 + if ($report.status -ne 'synthetic-zip-staging-selftest-passed' -or
93 + $report.ownerBackupUsed -ne $false -or
94 + $report.sqlConnected -ne $false -or
95 + $report.financialDataImported -ne $false -or
96 + $report.canImport -ne $false) {
97 + throw 'A02 ZIP staging synthetic selftest safety contract failed'
98 + }
99 + - name: Verify SQL media preflight refuses unsafe input (synthetic; no engine setup)
100 + shell: pwsh
101 + run: |
102 + $output = & powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File './scripts/a02-offline-sql-setup-preflight.ps1' -Mode Test
103 + if ($LASTEXITCODE -ne 0) { throw 'A02 offline SQL preflight synthetic selftest failed' }
104 + $result = ($output | Out-String | ConvertFrom-Json)
105 + if ($result.status -ne 'synthetic-offline-sql-setup-preflight-passed' -or
106 + $result.installerStarted -ne $false -or
107 + $result.registryRead -ne $false -or
108 + $result.backupOpened -ne $false -or
109 + $result.databaseModified -ne $false -or
110 + $result.canImport -ne $false) {
111 + throw 'A02 SQL offline preflight selftest breached no-write contract'
112 + }
113 + - name: Actual synthetic SQL LocalDB backup and isolated restore
114 + shell: pwsh
115 + run: |
116 + $output = & powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File './scripts/a02-synthetic-sql-localdb-restore-smoke.ps1' -Mode Run
117 + if ($LASTEXITCODE -ne 0) { throw 'A02 synthetic SQL LocalDB live restore failed' }
118 + $report = ($output | Out-String | ConvertFrom-Json)
119 + if ($report.status -ne 'synthetic-localdb-restore-verified' -or
120 + $report.ownerBackupUsed -ne $false -or
121 + $report.restoreExecuted -ne $true -or
122 + $report.dbccPassed -ne $true -or
123 + $report.syntheticRecords -ne 2 -or
124 + $report.syntheticTotal -ne 80235 -or
125 + $report.canImport -ne $false) {
126 + throw 'A02 synthetic LocalDB restore did not satisfy safety/reconciliation contract'
127 + }
128 - name: Build Tauri installer
129 run: npm exec tauri build
130 - name: Inspect produced Windows x64 installer and checksum