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

Set safe read-only pull-request CI with regression, audit and Windows preview artifacts

davoodmehraban89 committed Oct 13, 2026 at 14:45 UTC 6b1ea50411ee3fbe39ad775e95c94a6b98381e17
1 file changed +81
.github/workflows/pr-quality-gates.yml new
+81
@@ -0,0 +1,81 @@
1 +name: PR Quality Gates — accounting, Windows and packaging
2 +
3 +on:
4 + pull_request:
5 + branches:
6 + - main
7 + workflow_dispatch:
8 +
9 +permissions:
10 + contents: read
11 +
12 +concurrency:
13 + group: pr-quality-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14 + cancel-in-progress: true
15 +
16 +jobs:
17 + node-quality:
18 + name: Tests, frontend build and production dependency audit
19 + runs-on: ubuntu-latest
20 + timeout-minutes: 20
21 + steps:
22 + - name: Checkout immutable PR snapshot
23 + uses: actions/checkout@v4
24 + with:
25 + persist-credentials: false
26 + - name: Install Node.js
27 + uses: actions/setup-node@v4
28 + with:
29 + node-version: '22'
30 + cache: npm
31 + - name: Clean install
32 + run: npm ci
33 + - name: Full automated regression suite
34 + run: npm test
35 + - name: Build frontend bundle
36 + run: npm run build
37 + - name: Audit production dependencies for high or critical advisories
38 + run: npm audit --omit=dev --audit-level=high
39 +
40 + windows-installer:
41 + name: Windows native build and preview artifact (not a release)
42 + needs: node-quality
43 + runs-on: windows-latest
44 + timeout-minutes: 55
45 + steps:
46 + - name: Checkout immutable PR snapshot
47 + uses: actions/checkout@v4
48 + with:
49 + persist-credentials: false
50 + - name: Install Node.js
51 + uses: actions/setup-node@v4
52 + with:
53 + node-version: '22'
54 + cache: npm
55 + - name: Install Rust toolchain
56 + uses: dtolnay/rust-toolchain@stable
57 + - name: Clean install
58 + run: npm ci
59 + - name: Windows integration regression
60 + run: npm test
61 + - name: Build Tauri installer
62 + run: npm exec tauri build
63 + - name: Inspect produced Windows x64 installer and checksum
64 + shell: pwsh
65 + run: |
66 + $files = @(Get-ChildItem 'src-tauri/target/release/bundle/nsis/*x64-setup.exe' -ErrorAction SilentlyContinue)
67 + if ($files.Count -ne 1) { throw 'Exactly one x64 NSIS installer is required' }
68 + $file=$files[0]
69 + if ($file.Length -lt 100000) { throw 'Installer suspiciously small' }
70 + $hash=(Get-FileHash $file.FullName -Algorithm SHA256).Hash
71 + $hash + ' ' + $file.Name | Out-File -FilePath SHA256SUMS.txt -Encoding ascii
72 + Write-Output ('PREVIEW_INSTALLER=' + $file.Name + ' SIZE=' + $file.Length + ' SHA256=' + $hash)
73 + - name: Upload preview installer for review (no public release)
74 + uses: actions/upload-artifact@v4
75 + with:
76 + name: factor-easypro-windows-pr-preview
77 + path: |
78 + src-tauri/target/release/bundle/nsis/*x64-setup.exe
79 + SHA256SUMS.txt
80 + retention-days: 7
81 + if-no-files-found: error