Skip to content

Commit 7054ea8

Browse files
Stabilize WinGet fetch in test workflow
1 parent 4446af3 commit 7054ea8

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/dotnet-test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,28 @@ jobs:
5151
restore-keys: |
5252
${{ runner.os }}-nuget-
5353
54+
- name: Restore WinGet CLI cache
55+
id: winget-cache
56+
uses: actions/cache/restore@v5
57+
with:
58+
path: src/UniGetUI.PackageEngine.Managers.WinGet/winget-cli_x64
59+
key: winget-cli-${{ runner.os }}-x64-${{ hashFiles('scripts/fetch-winget-cli.ps1') }}
60+
61+
- name: Fetch WinGet CLI bundle
62+
if: steps.winget-cache.outputs.cache-hit != 'true'
63+
shell: pwsh
64+
env:
65+
GITHUB_TOKEN: ${{ github.token }}
66+
run: |
67+
.\scripts\fetch-winget-cli.ps1 -Architectures @('x64') -Force
68+
69+
- name: Save WinGet CLI cache
70+
if: steps.winget-cache.outputs.cache-hit != 'true'
71+
uses: actions/cache/save@v5
72+
with:
73+
path: src/UniGetUI.PackageEngine.Managers.WinGet/winget-cli_x64
74+
key: ${{ steps.winget-cache.outputs.cache-primary-key }}
75+
5476
- name: Install dependencies
5577
working-directory: src
5678
run: dotnet restore UniGetUI.sln
@@ -64,5 +86,7 @@ jobs:
6486

6587
- name: Run Tests
6688
working-directory: src
89+
env:
90+
GITHUB_TOKEN: ${{ github.token }}
6791
run: dotnet test UniGetUI.sln --no-restore --verbosity q --nologo
6892

0 commit comments

Comments
 (0)