From 84d24eeaabc1f9d1f6d254f23448e2bcd09a0d48 Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Tue, 23 Dec 2025 17:31:09 -0500 Subject: [PATCH 1/6] ci: install winget via Repair-WinGetPackageManager --- .github/workflows/build.yaml | 12 +++++++----- .github/workflows/docs.yaml | 12 +++++++----- .github/workflows/lint.yaml | 17 +++++++---------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f6a0da8..21f7629 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -72,15 +72,17 @@ jobs: shell: pwsh run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - name: Install Winget - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + if: matrix.runner.name == 'windows-11-arm' + shell: pwsh + run: | + Repair-WinGetPackageManager -Latest -Force + Write-Output "Winget Version: $(winget --version)" + - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm with: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 210b5ec..4d7318d 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -70,15 +70,17 @@ jobs: shell: pwsh run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - name: Install Winget - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + if: matrix.runner.name == 'windows-11-arm' + shell: pwsh + run: | + Repair-WinGetPackageManager -Latest -Force + Write-Output "Winget Version: $(winget --version)" + - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index df24fb4..55cc4a8 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -68,15 +68,17 @@ jobs: shell: pwsh run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - name: Install Winget - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + if: matrix.runner.name == 'windows-11-arm' + shell: pwsh + run: | + Repair-WinGetPackageManager -Latest -Force + Write-Output "Winget Version: $(winget --version)" + - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm with: @@ -129,11 +131,6 @@ jobs: shell: pwsh run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - name: Install Winget - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force From 5e5467fbf2c6be8f5eb9f8bcaff24b5ab12c28a9 Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Thu, 25 Dec 2025 14:53:25 -0500 Subject: [PATCH 2/6] ci: refactor Winget installation to use reusable action --- .github/workflows/build.yaml | 13 ++++--------- .github/workflows/docs.yaml | 13 ++++--------- .github/workflows/lint.yaml | 18 ++++++------------ 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 21f7629..074d9ea 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -72,16 +72,11 @@ jobs: shell: pwsh run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - name: Install Winget PowerShell Module - shell: pwsh - run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force - - name: Install Winget - if: matrix.runner.name == 'windows-11-arm' - shell: pwsh - run: | - Repair-WinGetPackageManager -Latest -Force - Write-Output "Winget Version: $(winget --version)" + uses: ./.github/actions/install-winget + with: + # windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95). + force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }} - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 4d7318d..254594b 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -70,16 +70,11 @@ jobs: shell: pwsh run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - name: Install Winget PowerShell Module - shell: pwsh - run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force - - name: Install Winget - if: matrix.runner.name == 'windows-11-arm' - shell: pwsh - run: | - Repair-WinGetPackageManager -Latest -Force - Write-Output "Winget Version: $(winget --version)" + uses: ./.github/actions/install-winget + with: + # windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95). + force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }} - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 55cc4a8..cf0f458 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -68,16 +68,11 @@ jobs: shell: pwsh run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - name: Install Winget PowerShell Module - shell: pwsh - run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force - - name: Install Winget - if: matrix.runner.name == 'windows-11-arm' - shell: pwsh - run: | - Repair-WinGetPackageManager -Latest -Force - Write-Output "Winget Version: $(winget --version)" + uses: ./.github/actions/install-winget + with: + # windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95). + force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }} - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm @@ -131,9 +126,8 @@ jobs: shell: pwsh run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - name: Install Winget PowerShell Module - shell: pwsh - run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + uses: ./.github/actions/install-winget - name: Install WDK (${{ matrix.wdk }}) uses: ./.github/actions/install-wdk From 6bf8b16b2b5850b04d4fff9562f030a8a4e3a389 Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Thu, 25 Dec 2025 14:56:24 -0500 Subject: [PATCH 3/6] ci: remove redundant steps for copying actions and installing Winget and WDK --- .github/workflows/lint.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index cf0f458..760698a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -122,19 +122,6 @@ jobs: .github/actions sparse-checkout-cone-mode: false - - name: Copy actions to workspace - shell: pwsh - run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ - - - name: Install Winget - uses: ./.github/actions/install-winget - - - name: Install WDK (${{ matrix.wdk }}) - uses: ./.github/actions/install-wdk - with: - version: ${{ matrix.wdk }} - source: winget - - name: Install Rust Toolchain uses: dtolnay/rust-toolchain@stable From ac01ea7eaf45e02268c6b1873c95c4f6a0a0c222 Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Thu, 25 Dec 2025 15:00:38 -0500 Subject: [PATCH 4/6] ci: remove checkout step for windows-drivers-rs actions --- .github/workflows/lint.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 760698a..e115983 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -112,16 +112,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Checkout windows-drivers-rs actions - uses: actions/checkout@v4 - with: - repository: microsoft/windows-drivers-rs - ref: main - path: _temp/windows-drivers-rs - sparse-checkout: | - .github/actions - sparse-checkout-cone-mode: false - - name: Install Rust Toolchain uses: dtolnay/rust-toolchain@stable From a144e70a74091a3900e8665f53dbb4a74b8bc35f Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Thu, 25 Dec 2025 15:01:08 -0500 Subject: [PATCH 5/6] temporarily use pr branch --- .github/workflows/build.yaml | 4 ++-- .github/workflows/docs.yaml | 4 ++-- .github/workflows/lint.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 074d9ea..d3437df 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,7 +5,7 @@ on: pull_request: merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - - cron: "0 11 * * *" + - cron: '0 11 * * *' concurrency: group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }} @@ -62,7 +62,7 @@ jobs: uses: actions/checkout@v4 with: repository: microsoft/windows-drivers-rs - ref: main + ref: refs/pull/597/head path: _temp/windows-drivers-rs sparse-checkout: | .github/actions diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 254594b..5faebfd 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -5,7 +5,7 @@ on: pull_request: merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - - cron: "0 11 * * *" + - cron: '0 11 * * *' concurrency: group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }} @@ -60,7 +60,7 @@ jobs: uses: actions/checkout@v4 with: repository: microsoft/windows-drivers-rs - ref: main + ref: refs/pull/597/head path: _temp/windows-drivers-rs sparse-checkout: | .github/actions diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e115983..7732843 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -58,7 +58,7 @@ jobs: uses: actions/checkout@v4 with: repository: microsoft/windows-drivers-rs - ref: main + ref: refs/pull/597/head path: _temp/windows-drivers-rs sparse-checkout: | .github/actions From 4135e485ba3ec79efc09b607ad424ac3828527ed Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Thu, 25 Dec 2025 15:50:49 -0500 Subject: [PATCH 6/6] restore main --- .github/workflows/build.yaml | 2 +- .github/workflows/docs.yaml | 2 +- .github/workflows/lint.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d3437df..e9437a1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -62,7 +62,7 @@ jobs: uses: actions/checkout@v4 with: repository: microsoft/windows-drivers-rs - ref: refs/pull/597/head + ref: main path: _temp/windows-drivers-rs sparse-checkout: | .github/actions diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 5faebfd..fec6a36 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -60,7 +60,7 @@ jobs: uses: actions/checkout@v4 with: repository: microsoft/windows-drivers-rs - ref: refs/pull/597/head + ref: main path: _temp/windows-drivers-rs sparse-checkout: | .github/actions diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 7732843..a3bacda 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -5,7 +5,7 @@ on: pull_request: merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - - cron: "0 11 * * *" + - cron: '0 11 * * *' concurrency: group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }} @@ -58,7 +58,7 @@ jobs: uses: actions/checkout@v4 with: repository: microsoft/windows-drivers-rs - ref: refs/pull/597/head + ref: main path: _temp/windows-drivers-rs sparse-checkout: | .github/actions