1+ name : Build and Run Windows Navigation Tests
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+
8+ jobs :
9+ software_navigation_tests :
10+ runs-on : windows-2022
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v2
14+
15+ - name : Setup MSBuild
16+ uses : microsoft/setup-msbuild@v1.1
17+ with :
18+ vs-prerelease : true
19+
20+ - name : Set up .NET
21+ uses : actions/setup-dotnet@v1
22+ with :
23+ dotnet-version : ' 9.0.x'
24+
25+ - name : Install MAUI workloads
26+ run : |
27+ dotnet workload install maui
28+
29+ - name : Install Appium and Drivers
30+ run : |
31+ npm install -g appium --unsafe-perm=true --allow-root
32+ appium driver install --source=npm appium-windows-driver
33+
34+ - name : Start Appium Server
35+ run : |
36+ nohup appium --log appium.log &
37+
38+ - name : Restore MAUI App for Windows
39+ run : dotnet restore TransactionProcessor.Mobile.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
40+
41+ - name : Build Code
42+ run : dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -f net9.0-android -c Release --no-restore
43+
44+ # ✅ Restore the MAUI App separately with RID
45+ # - name: Restore MAUI App Project
46+ # run: dotnet restore TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj --runtime win10-x64 --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
47+
48+ # ✅ Restore all other projects without RID (via .sln)
49+ # - name: Restore Solution (excluding RID conflicts)
50+ # run: dotnet restore TransactionProcessor.Mobile.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
51+
52+ # ✅ Build the MAUI App with RuntimeIdentifier
53+ # - name: Build MAUI App
54+ # run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -f net9.0-windows10.0.19041.0 -c Release --runtime win10-x64 --no-restore
55+
56+ # ✅ Build all other projects (test libraries, class libs, etc.)
57+ # - name: Build Solution (non-MAUI projects)
58+ # run: dotnet build TransactionProcessor.Mobile.sln -c Release --no-restore
59+
60+ - name : Decrypt PFX File
61+ run : |
62+ echo "${{ secrets.WINDOWSSIGNINGCERT }}" > cert.pfx.asc
63+ certutil -decode cert.pfx.asc cert.pfx
64+
65+ - name : Add Cert to Store
66+ run : certutil -user -q -p ${{ secrets.WINDOWSSIGNINGCERTPWD }} -importpfx cert.pfx NoRoot
67+
68+ - name : Publish App
69+ run : |
70+ dotnet publish TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -c Release -f net9.0-windows10.0.19041.0 /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="${{ secrets.WINDOWSSIGNINGCERTTHUMBPRINT }}"
71+
72+ - name : List published files
73+ shell : pwsh
74+ run : |
75+ Get-ChildItem "D:\a\TransactionMobile\TransactionMobile\TransactionProcessor.Mobile\bin\Release\net9.0-windows10.0.19041.0" -Recurse -File | ForEach-Object { $_.FullName }
76+
77+ - name : Install App
78+ shell : powershell
79+ # run: |
80+ # Add-AppxPackage .\TransactionProcessor.Mobile\bin\Release\net9.0-windows10.0.19041.0\win10-x64\AppPackages\TransactionProcessor.Mobile_1.0.0.1_Test\TransactionProcessor.Mobile_1.0.0.1_x64.msix
81+ run : |
82+ Import-Module Appx
83+ .\TransactionProcessor.Mobile/bin/Release\net9.0-windows10.0.19041.0\win10-x64\AppPackages\TransactionProcessor.Mobile_1.0.0.1_Test\Install.ps1 -Force
84+
85+ - name : Run Windows Navigation Tests
86+ run : dotnet test TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj --filter "(Category=PRNavTest)&(Category=Windows)" --no-restore
87+
88+ - name : Upload Appium Logs on Failure
89+ if : failure()
90+ uses : actions/upload-artifact@v4
91+ with :
92+ name : windows-software_navigation_tests_appium
93+ path : appium.log
94+
95+
0 commit comments