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

ci(a08): stage standalone manual NSIS artifact reuse workflow

Davood Mehraban committed Nov 23, 2026 at 22:10 UTC 0c870c39e9e469fd1fc4df8c11f723aa52cc664c
1 file changed +75
.github/workflows/a08-targeted-native-reuse.yml new
+75
@@ -0,0 +1,75 @@
1 +name: A08 targeted installed Windows benchmark (reuse NSIS)
2 +on:
3 + workflow_dispatch:
4 + inputs:
5 + artifact_run_id:
6 + description: 'Native Windows workflow run holding candidate NSIS from this exact commit'
7 + required: true
8 + type: string
9 + source_sha:
10 + description: 'Exact 40-character commit SHA used to build the installer (not the workflow dispatch SHA)'
11 + required: true
12 + type: string
13 + expected_version:
14 + description: 'Candidate installer version from that run'
15 + required: true
16 + type: string
17 +permissions:
18 + contents: read
19 + actions: read
20 +jobs:
21 + targeted-native-a08:
22 + runs-on: windows-latest
23 + timeout-minutes: 35
24 + steps:
25 + # Re-run the benchmark harness from the exact binary-producing commit.
26 + # The workflow_dispatch event itself may be at a newer commit.
27 + - uses: actions/checkout@v4
28 + with:
29 + ref: ${{ inputs.source_sha }}
30 + persist-credentials: false
31 + - uses: actions/setup-node@v4
32 + with:
33 + node-version: '22'
34 + - name: Verify artifact source SHA and workflow identity
35 + shell: pwsh
36 + env:
37 + GH_TOKEN: ${{ github.token }}
38 + SOURCE_RUN: ${{ inputs.artifact_run_id }}
39 + SOURCE_SHA: ${{ inputs.source_sha }}
40 + EXPECTED_VERSION: ${{ inputs.expected_version }}
41 + run: |
42 + if ($env:SOURCE_RUN -notmatch '^[0-9]+$') { throw 'Invalid source run ID' }
43 + if ($env:SOURCE_SHA -notmatch '^[a-fA-F0-9]{40}$') { throw 'Invalid source commit SHA' }
44 + if ((git rev-parse HEAD).Trim() -ne $env:SOURCE_SHA) { throw 'Checked out source SHA mismatch' }
45 + if ($env:EXPECTED_VERSION -notmatch '^\d+\.\d+\.\d+$') { throw 'Invalid candidate version' }
46 + $run=gh api "repos/$env:GITHUB_REPOSITORY/actions/runs/$env:SOURCE_RUN" | ConvertFrom-Json
47 + if ($run.head_sha -ne $env:SOURCE_SHA -or $run.status -ne 'completed' -or
48 + $run.conclusion -ne 'success' -or $run.event -notin @('pull_request','push','workflow_dispatch') -or
49 + $run.path -notmatch 'windows-vm-native-lab.yml') {
50 + throw 'Source must be a completed native lab run on exactly this commit'
51 + }
52 + Write-Host ("Verified candidate run "+$run.html_url+" SHA "+$run.head_sha)
53 + - name: Reuse already-built candidate NSIS
54 + uses: actions/download-artifact@v4
55 + with:
56 + run-id: ${{ inputs.artifact_run_id }}
57 + github-token: ${{ github.token }}
58 + name: phase-a-native-candidate-nsis
59 + path: test-installer
60 + - name: Run only real installed WebView2 A08 10k/50k benchmark
61 + shell: pwsh
62 + env:
63 + EXPECTED_VERSION: ${{ inputs.expected_version }}
64 + run: |
65 + $files=@(Get-ChildItem test-installer -Recurse -Filter '*x64-setup.exe')
66 + if ($files.Count -ne 1) { throw 'Expected exactly one reused NSIS installer' }
67 + ./scripts/windows-vm-targeted-a08.ps1 -Installer $files[0].FullName -ExpectedVersion $env:EXPECTED_VERSION
68 + - name: Upload targeted native A08 evidence
69 + if: always()
70 + uses: actions/upload-artifact@v4
71 + with:
72 + name: a08-targeted-installed-webview2-evidence
73 + path: ${{ runner.temp }}/factor-a08-targeted-native/reports/*.json
74 + retention-days: 14
75 + if-no-files-found: warn