Skip to content

ci: install winget via Repair-WinGetPackageManager#597

Merged
wmmc88 merged 2 commits intomicrosoft:mainfrom
wmmc88:fix-arm64-get-winget-package
Dec 26, 2025
Merged

ci: install winget via Repair-WinGetPackageManager#597
wmmc88 merged 2 commits intomicrosoft:mainfrom
wmmc88:fix-arm64-get-winget-package

Conversation

@wmmc88
Copy link
Collaborator

@wmmc88 wmmc88 commented Dec 23, 2025

This pull request refactors the GitHub Action for installing Winget on Windows runners, simplifying the installation process and improving support for images that may not include winget-cli (notably Windows ARM64 partner images). The changes remove the need for a GitHub token, streamline the workflow YAML files, and introduce a new force-cli-install input to control Winget installation behavior.

Action and Workflow Refactoring:

  • Refactored .github/actions/install-winget/action.yaml to:

    • Remove the requirement for a GITHUB_TOKEN input and all related authenticated API requests.
    • Add a new force-cli-install input to optionally force installation of the latest Winget CLI for images missing winget-cli.
    • Simplify the installation steps by using the Microsoft.WinGet.Client PowerShell module and the Repair-WinGetPackageManager command when forced installation is needed.
  • Updated all workflow files (build.yaml, test.yaml, lint.yaml, docs.yaml, local-development-makefile.yaml) to:

    • Remove the conditional step for installing the Winget PowerShell module and the explicit GITHUB_TOKEN input.
    • Use the new force-cli-install input to control when Winget should be forcibly installed, specifically for the windows-11-arm runner image. [1] [2] [3] [4] [5]

Improved Support for Windows ARM64:

  • Ensured that the windows-11-arm runner image, which does not include winget-cli by default, will have Winget installed reliably by setting force-cli-install: true for this runner. [1] [2] [3] [4] [5]

General Simplification and Reliability:

  • Reduced complexity and improved maintainability by consolidating installation logic and removing unnecessary steps from both the action and workflow files.

These changes make Winget installation more robust and easier to maintain across different Windows runner environments.

Related to microsoft/Windows-rust-driver-samples#48

Copilot AI review requested due to automatic review settings December 23, 2025 21:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request simplifies Winget installation on Windows ARM64 runners by replacing a custom composite GitHub Action with a direct PowerShell command (Repair-WinGetPackageManager -Latest -Force). The change reduces complexity by leveraging the built-in capabilities of the Microsoft.WinGet.Client PowerShell module, which is now installed on all Windows runners before the Winget installation step.

Key changes:

  • Removed the custom .github/actions/install-winget composite action that handled manual download and installation of Winget v1.11.400 with dependencies
  • Updated all workflow files to use Repair-WinGetPackageManager -Latest -Force for ARM64 runners
  • The PowerShell module installation step is now unconditionally executed on all runners (needed by downstream actions), while Winget repair/installation remains conditional on ARM64

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/actions/install-winget/action.yaml Removed the entire custom composite action that manually downloaded and installed Winget with architecture-specific dependencies
.github/workflows/test.yaml Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.arch == 'arm64' conditional
.github/workflows/local-development-makefile.yaml Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.name == 'windows-11-arm' conditional
.github/workflows/lint.yaml Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.name == 'windows-11-arm' conditional
.github/workflows/docs.yaml Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.name == 'windows-11-arm' conditional
.github/workflows/build.yaml Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.name == 'windows-11-arm' conditional

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.67%. Comparing base (723a4eb) to head (e5124ba).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #597   +/-   ##
=======================================
  Coverage   82.67%   82.67%           
=======================================
  Files          25       25           
  Lines        7135     7135           
  Branches     7135     7135           
=======================================
  Hits         5899     5899           
  Misses       1107     1107           
  Partials      129      129           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gurry
Copy link
Contributor

gurry commented Dec 26, 2025

@wmmc88 You might want to update this statement in the PR description: "The custom .github/actions/install-winget composite action and its usage have been removed from all workflow files."

@wmmc88 wmmc88 added this pull request to the merge queue Dec 26, 2025
@wmmc88 wmmc88 removed this pull request from the merge queue due to a manual request Dec 26, 2025
@wmmc88 wmmc88 added this pull request to the merge queue Dec 26, 2025
Merged via the queue into microsoft:main with commit dd8fdff Dec 26, 2025
229 checks passed
@wmmc88 wmmc88 deleted the fix-arm64-get-winget-package branch December 26, 2025 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants