Skip to content

Avoid repeated preindexed source refreshes #40

Avoid repeated preindexed source refreshes

Avoid repeated preindexed source refreshes #40

Workflow file for this run

name: Parity Test
on:
push:
branches:
- master
- settings
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
parity-test:
name: Parity Test
runs-on: windows-latest
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Setup Rust
shell: pwsh
run: |
rustup toolchain install stable --profile minimal --target x86_64-pc-windows-msvc --target aarch64-pc-windows-msvc
rustup default stable
- name: Build pinget-cli
shell: pwsh
run: |
cargo build -p pinget-cli --manifest-path rust/Cargo.toml
- name: Build native COM DLLs
shell: pwsh
env:
RUSTFLAGS: -C target-feature=+crt-static
run: |
cargo build -p pinget-com --manifest-path rust/Cargo.toml --release --target x86_64-pc-windows-msvc
cargo build -p pinget-com --manifest-path rust/Cargo.toml --release --target aarch64-pc-windows-msvc
- name: Build C# CLI and PowerShell module
shell: pwsh
run: |
dotnet build dotnet/Devolutions.Pinget.slnx -c Release
pwsh -NoLogo -NoProfile -File (Resolve-Path 'scripts/Build-PowerShellModule.ps1') -NoBuild -OutputRoot dist/powershell-module -Clean
- name: Run Windows parity coherence tests
shell: pwsh
# Point pinget at winget's packaged LocalState so pin/source/settings
# stores are shared with the system winget. Without this, non-packaged
# pinget reads %LocalAppData%\Devolutions\Pinget\ and the cross-CLI
# coherence assertions cannot see each other's state.
run: |
$env:PINGET_APPROOT = Join-Path $env:LOCALAPPDATA 'Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState'
$rustPinget = Resolve-Path 'rust/target/debug/pinget.exe'
$dotnetPinget = Resolve-Path 'dotnet/src/Devolutions.Pinget.Cli/bin/Release/net10.0/pinget.exe'
$pingetModule = Resolve-Path 'dist/powershell-module/Devolutions.Pinget.Client/Devolutions.Pinget.Client.psd1'
pwsh -NoLogo -NoProfile -File (Resolve-Path 'scripts/Parity-Compare-WingetParity.ps1') -RustWinget $rustPinget -DotnetWinget $dotnetPinget -PowerShellModulePath $pingetModule
- name: Run upgrade-parity diff
shell: pwsh
# CI runners have very few user-installed apps so the row counts are
# small; the value here is regression-catching: a winget table-format
# change or a break in pinget's `upgrade --output json` schema will
# surface as a parse failure before users notice. The fixture is
# uploaded as an artifact so cross-machine corpora can be assembled
# from real machines later.
run: |
$rustPinget = Resolve-Path 'rust/target/debug/pinget.exe'
pwsh -NoLogo -NoProfile -File (Resolve-Path 'scripts/Test-UpgradeParity.ps1') `
-Pinget $rustPinget `
-FixturePath 'parity-upgrade-fixture.json' `
-FailOnDiff
- name: Upload parity fixture
if: always()
uses: actions/upload-artifact@v4
with:
name: parity-upgrade-fixture
path: parity-upgrade-fixture.json
if-no-files-found: ignore