[BLOCKED: ARIEC stabilization] Consume hybrid report planner with physical evidence #218
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate ARSAS Windows installer | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - "installer/**" | |
| - "scripts/build-windows-installer.ps1" | |
| - "scripts/create-windows-release-checksums.ps1" | |
| - "scripts/publish-windows-portable.ps1" | |
| - ".github/workflows/installer-windows.yml" | |
| - ".github/workflows/release-windows.yml" | |
| - "ArIED61850Tester.csproj" | |
| - "Directory.Build.props" | |
| - "VERSION" | |
| - "engines/ARIEC61850.lock.json" | |
| pull_request: | |
| paths: | |
| - "installer/**" | |
| - "scripts/build-windows-installer.ps1" | |
| - "scripts/create-windows-release-checksums.ps1" | |
| - "scripts/publish-windows-portable.ps1" | |
| - ".github/workflows/installer-windows.yml" | |
| - ".github/workflows/release-windows.yml" | |
| - "ArIED61850Tester.csproj" | |
| - "Directory.Build.props" | |
| - "VERSION" | |
| - "engines/ARIEC61850.lock.json" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| installer: | |
| name: Build and install/uninstall smoke test | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout ARSAS application | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ArIED61850Tester | |
| - name: Resolve application version and immutable engine lock | |
| shell: powershell | |
| run: | | |
| [xml]$versionProps = Get-Content ".\ArIED61850Tester\Directory.Build.props" -Raw | |
| [xml]$project = Get-Content ".\ArIED61850Tester\ArIED61850Tester.csproj" -Raw | |
| $version = [string]$versionProps.Project.PropertyGroup.Version | |
| $projectVersion = [string]$project.Project.PropertyGroup.Version | |
| $versionFile = (Get-Content ".\ArIED61850Tester\VERSION" -Raw).Trim() | |
| if ($version -notmatch '^\d+\.\d+\.\d+([-.][0-9A-Za-z.-]+)?$' -or | |
| $projectVersion -ne $version -or | |
| $versionFile -ne $version) { | |
| throw "ARSAS version metadata is inconsistent: props=$version project=$projectVersion VERSION=$versionFile" | |
| } | |
| $lock = Get-Content ".\ArIED61850Tester\engines\ARIEC61850.lock.json" -Raw | ConvertFrom-Json | |
| if ($lock.repository -notmatch '^[^/]+/[^/]+$' -or | |
| $lock.ref -ne 'main' -or | |
| $lock.commit -notmatch '^[0-9a-f]{40}$') { | |
| throw "ARIEC61850 lock metadata is invalid." | |
| } | |
| "APP_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| "ARIEC61850_REPOSITORY=$($lock.repository)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| "ARIEC61850_COMMIT=$($lock.commit)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Checkout immutable ARIEC61850 engine revision | |
| shell: powershell | |
| run: | | |
| git clone --quiet --filter=blob:none --no-checkout "https://github.com/$env:ARIEC61850_REPOSITORY.git" ARIEC61850 | |
| git -C .\ARIEC61850 fetch --quiet --depth 1 origin $env:ARIEC61850_COMMIT | |
| git -C .\ARIEC61850 checkout --quiet --detach $env:ARIEC61850_COMMIT | |
| $actual = (git -C .\ARIEC61850 rev-parse HEAD).Trim() | |
| if ($actual -ne $env:ARIEC61850_COMMIT) { | |
| throw "ARIEC61850 pin mismatch. Expected $env:ARIEC61850_COMMIT, got $actual." | |
| } | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore, build and test application solution | |
| shell: powershell | |
| run: | | |
| dotnet restore .\ArIED61850Tester\ArIED61850Tester.sln | |
| if ($LASTEXITCODE -ne 0) { throw "Solution restore failed." } | |
| dotnet build .\ArIED61850Tester\ArIED61850Tester.sln -c Release --no-restore | |
| if ($LASTEXITCODE -ne 0) { throw "Solution build failed." } | |
| dotnet test .\ArIED61850Tester\tests\ARSAS.Tests\ARSAS.Tests.csproj -c Release --no-build --no-restore | |
| if ($LASTEXITCODE -ne 0) { throw "Application regression tests failed." } | |
| - name: Publish installer source | |
| shell: powershell | |
| run: | | |
| .\ArIED61850Tester\scripts\publish-windows-portable.ps1 ` | |
| -Version $env:APP_VERSION ` | |
| -Runtime win-x64 ` | |
| -SingleFile $false ` | |
| -SelfContained $true ` | |
| -EngineProject "$env:GITHUB_WORKSPACE\ARIEC61850\src\AR.Iec61850\AR.Iec61850.csproj" ` | |
| -NpcapProject "$env:GITHUB_WORKSPACE\ARIEC61850\src\AR.Iec61850.Transports.Npcap\AR.Iec61850.Transports.Npcap.csproj" | |
| - name: Install Inno Setup compiler | |
| shell: powershell | |
| run: choco install innosetup --no-progress --yes | |
| - name: Compile installer | |
| shell: powershell | |
| run: | | |
| .\ArIED61850Tester\scripts\build-windows-installer.ps1 ` | |
| -Version $env:APP_VERSION ` | |
| -Runtime win-x64 ` | |
| -PublishedDirectory "$env:GITHUB_WORKSPACE\ArIED61850Tester\dist\ARSAS-$env:APP_VERSION-win-x64" ` | |
| -OutputDirectory "$env:GITHUB_WORKSPACE\ArIED61850Tester\dist" | |
| - name: Silent install and uninstall smoke test | |
| shell: powershell | |
| run: | | |
| $installerPath = ".\ArIED61850Tester\dist\ARSAS-$env:APP_VERSION-win-x64-setup.exe" | |
| if (-not (Test-Path $installerPath -PathType Leaf)) { throw "Installer not found: $installerPath" } | |
| $installRoot = Join-Path $env:RUNNER_TEMP "ARSAS-installer-smoke" | |
| if (Test-Path $installRoot) { Remove-Item $installRoot -Recurse -Force } | |
| $install = Start-Process -FilePath $installerPath -ArgumentList @( | |
| "/VERYSILENT", | |
| "/SUPPRESSMSGBOXES", | |
| "/NORESTART", | |
| "/SP-", | |
| "/CURRENTUSER", | |
| "/DIR=$installRoot" | |
| ) -Wait -PassThru | |
| if ($install.ExitCode -ne 0) { throw "Installer exited with code $($install.ExitCode)." } | |
| foreach ($file in @("ARSAS.exe", "AR.Iec61850.Transports.Npcap.dll", "SharpPcap.dll", "PacketDotNet.dll")) { | |
| $installedFile = Join-Path $installRoot $file | |
| if (-not (Test-Path $installedFile -PathType Leaf)) { throw "Missing installed file: $installedFile" } | |
| } | |
| $uninstaller = Join-Path $installRoot "unins000.exe" | |
| if (-not (Test-Path $uninstaller -PathType Leaf)) { throw "Uninstaller was not created." } | |
| $uninstall = Start-Process -FilePath $uninstaller -ArgumentList @( | |
| "/VERYSILENT", | |
| "/SUPPRESSMSGBOXES", | |
| "/NORESTART" | |
| ) -Wait -PassThru | |
| if ($uninstall.ExitCode -ne 0) { throw "Uninstaller exited with code $($uninstall.ExitCode)." } | |
| - name: Create release checksums | |
| shell: powershell | |
| run: | | |
| .\ArIED61850Tester\scripts\create-windows-release-checksums.ps1 ` | |
| -Version $env:APP_VERSION ` | |
| -Runtime win-x64 ` | |
| -DistDirectory "$env:GITHUB_WORKSPACE\ArIED61850Tester\dist" | |
| - name: Upload installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ARSAS-${{ env.APP_VERSION }}-win-x64-installer | |
| if-no-files-found: error | |
| path: | | |
| ArIED61850Tester/dist/ARSAS-${{ env.APP_VERSION }}-win-x64-setup.exe | |
| ArIED61850Tester/dist/SHA256SUMS.txt |