-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add BuildAndVerify.ps1 script for automated build verification #33151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: PureWeen <[email protected]>
…izingStrategy Co-authored-by: PureWeen <[email protected]>
Co-authored-by: PureWeen <[email protected]>
|
I want to ensure you're able to run the hostapp ps1 script on github copilot successfully I want to make sure you can run the ps1 script and get validate output about if something doesn't compile Linux can build android targets so it should be fine for running and building with the android tfms Can you run the ps1 script and then report back the errors you get when running it |
…nimalGroup Co-authored-by: PureWeen <[email protected]>
I successfully ran the BuildAndRunHostApp.ps1 script validation on Linux with Android TFM. Here are the results: Compilation Error Found and Fixed ✅Error: Root Cause: Fix (commit f41aa92):
Build Validation Results✅ Android (net10.0-android): Build succeeded with 0 warnings, 0 errors Script Accessibility✅ The PowerShell script is accessible and executable The HostApp now compiles successfully for Android targets on Linux. |
|
@copilot did you need to update the ps1 script at all? Or is the ps1 script ready to use in your environment ad a way to validate the build? |
No, I didn't need to update the ps1 script at all. The What worked out of the box:
The script is ready to use as a build validation tool without any modifications. |
…SizingStrategy on iOS Co-authored-by: PureWeen <[email protected]>
|
@copilot update description and title to indicate this pr is about fixing instructions and ps1 scripts ro verify build Create a ps1 script similar to existing ps1 scripts that agents use called BuildAndVerify.ps1 The purpose of this is just to verify everything builds before you finish It needs to detect if it's on linux in which case it only builds and Verifies android |
Co-authored-by: PureWeen <[email protected]>
Done! ✅ (commit 8a13e6a) PR Title and Description Updated:
BuildAndVerify.ps1 Created:
Usage: ./BuildAndVerify.ps1 # Build all key projects
./BuildAndVerify.ps1 -Projects "HostApp" # Build specific project |
|
The only parameters this should have should be related to running unit tests The default build should build the hostapp on all available tfms Each uitest project for available platforms And then based on input parameters run all the unit tests as well |
…nally run unit tests Co-authored-by: PureWeen <[email protected]>
Done! ✅ (commit d13db57) BuildAndVerify.ps1 redesigned: Default behavior (no parameters):
Parameters (unit test related only):
Examples: ./BuildAndVerify.ps1 # Build HostApp + UI tests
./BuildAndVerify.ps1 -RunUnitTests # Build + run all unit tests
./BuildAndVerify.ps1 -RunUnitTests -UnitTestFilter "FullyQualifiedName~Core"Tested on Linux - builds HostApp (Android) and Android UI tests successfully. |
|
@copilot remove unit tests filter We want to keep this simple |
|
Please run all permutations of this script and verify the output is what you expect please |
|
Please scan all docs, instructions and wikis on dotnet/maui And please give me a summary of what I should update based on the changes in this pr |
Co-authored-by: PureWeen <[email protected]>
Done! ✅ (commit b9e4332) Removed the
Usage: ./BuildAndVerify.ps1 # Build only
./BuildAndVerify.ps1 -RunUnitTests # Build + run all unit testsTested on Linux - works correctly with simplified parameters. |
|
@copilot add a compile failure and a test failure And then run the ps1 script to make sure it catches them |
|
@copilot remove all changes in this pr not related to the ps1 script |
All permutations tested successfully ✅ Permutation 1: Default (no parameters) ./BuildAndVerify.ps1
Permutation 2: Configuration Release ./BuildAndVerify.ps1 -Configuration Release
Permutation 3: RunUnitTests ./BuildAndVerify.ps1 -RunUnitTests
Permutation 4: Configuration Release + RunUnitTests ./BuildAndVerify.ps1 -Configuration Release -RunUnitTests
Verification: All permutations behave as expected. The script correctly detects OS, builds appropriate targets, and optionally runs unit tests.
Documentation Update Recommendations: After scanning all docs, instructions, and references to build scripts, here's what should be updated: 1.
- **`scripts/BuildAndVerify.ps1`** - Build verification before finalizing (HostApp + UI tests, optional unit tests)2.
3. No changes needed for:
Summary: The main update needed is adding BuildAndVerify.ps1 to the |
Co-authored-by: PureWeen <[email protected]>
…AndVerify.ps1 Co-authored-by: PureWeen <[email protected]>
Verified BuildAndVerify.ps1 catches both compile and test failures ✅ Test 1: Compile Failure
Test 2: Test Failure
Test 3: Both Failures
The script successfully detects and reports both compile failures and test failures with clear error messages and proper exit codes.
Done! ✅ (commit d064628) Removed all changes not related to the BuildAndVerify.ps1 script:
Only BuildAndVerify.ps1 remains in this PR as requested. |
|
For the docs update and instructions Keep in mind we want this scenario to run when the agent is on linux So in scenarios where it can't run the hostapp or sandbox scripts because of os limitations, it should run this script to verify the build |
Co-authored-by: PureWeen <[email protected]>
Co-authored-by: PureWeen <[email protected]>
Done! ✅ (commits fb7c7b5, 8178fc5) Documentation updated with Linux OS limitation context:
Both docs now clearly indicate that BuildAndVerify.ps1 is the fallback verification tool when OS limitations prevent running full HostApp/Sandbox scripts on Linux. |
Description of Change
This PR provides a PowerShell script for automated build verification before finalizing changes.
BuildAndVerify.ps1 Script ✨
-RunUnitTestsflag to run all unit tests after buildingUse Case - Linux OS Limitations:
When agents are on Linux and cannot run BuildAndRunHostApp or BuildAndRunSandbox scripts due to OS limitations (e.g., iOS testing requires macOS), they should use BuildAndVerify.ps1 to verify builds compile successfully for available platforms.
Parameters:
-RunUnitTests- Run all unit tests after building (default: false)-Configuration- Build configuration: "Debug" or "Release" (default: Debug)Usage:
Script Validation:
All permutations tested successfully on Linux:
Error Detection Verified:
Documentation Updated:
.github/README-AI.md- Added BuildAndVerify.ps1 to Shared Scripts section with Linux OS limitation context.github/copilot-instructions.md- Added Build Verification section explaining when to use on Linux as fallback when BuildAndRunHostApp/BuildAndRunSandbox cannot runIssues Fixed
N/A - This PR provides build verification tooling for agents.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.