Skip to content

Commit 5e5467f

Browse files
committed
ci: refactor Winget installation to use reusable action
1 parent 84d24ee commit 5e5467f

File tree

3 files changed

+14
-30
lines changed

3 files changed

+14
-30
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,11 @@ jobs:
7272
shell: pwsh
7373
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
7474

75-
- name: Install Winget PowerShell Module
76-
shell: pwsh
77-
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
78-
7975
- name: Install Winget
80-
if: matrix.runner.name == 'windows-11-arm'
81-
shell: pwsh
82-
run: |
83-
Repair-WinGetPackageManager -Latest -Force
84-
Write-Output "Winget Version: $(winget --version)"
76+
uses: ./.github/actions/install-winget
77+
with:
78+
# windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95).
79+
force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }}
8580

8681
- name: Install LLVM ${{ matrix.llvm }}
8782
uses: ./.github/actions/install-llvm

.github/workflows/docs.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,11 @@ jobs:
7070
shell: pwsh
7171
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
7272

73-
- name: Install Winget PowerShell Module
74-
shell: pwsh
75-
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
76-
7773
- name: Install Winget
78-
if: matrix.runner.name == 'windows-11-arm'
79-
shell: pwsh
80-
run: |
81-
Repair-WinGetPackageManager -Latest -Force
82-
Write-Output "Winget Version: $(winget --version)"
74+
uses: ./.github/actions/install-winget
75+
with:
76+
# windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95).
77+
force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }}
8378

8479
- name: Install LLVM ${{ matrix.llvm }}
8580
uses: ./.github/actions/install-llvm

.github/workflows/lint.yaml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,11 @@ jobs:
6868
shell: pwsh
6969
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
7070

71-
- name: Install Winget PowerShell Module
72-
shell: pwsh
73-
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
74-
7571
- name: Install Winget
76-
if: matrix.runner.name == 'windows-11-arm'
77-
shell: pwsh
78-
run: |
79-
Repair-WinGetPackageManager -Latest -Force
80-
Write-Output "Winget Version: $(winget --version)"
72+
uses: ./.github/actions/install-winget
73+
with:
74+
# windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95).
75+
force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }}
8176

8277
- name: Install LLVM ${{ matrix.llvm }}
8378
uses: ./.github/actions/install-llvm
@@ -131,9 +126,8 @@ jobs:
131126
shell: pwsh
132127
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
133128

134-
- name: Install Winget PowerShell Module
135-
shell: pwsh
136-
run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
129+
- name: Install Winget
130+
uses: ./.github/actions/install-winget
137131

138132
- name: Install WDK (${{ matrix.wdk }})
139133
uses: ./.github/actions/install-wdk

0 commit comments

Comments
 (0)