diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml index 1d6236930..be0dffaea 100644 --- a/.github/workflows/dotnet-test.yml +++ b/.github/workflows/dotnet-test.yml @@ -51,6 +51,28 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- + - name: Restore WinGet CLI cache + id: winget-cache + uses: actions/cache/restore@v5 + with: + path: src/UniGetUI.PackageEngine.Managers.WinGet/winget-cli_x64 + key: winget-cli-${{ runner.os }}-x64-${{ hashFiles('scripts/fetch-winget-cli.ps1') }} + + - name: Fetch WinGet CLI bundle + if: steps.winget-cache.outputs.cache-hit != 'true' + shell: pwsh + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + .\scripts\fetch-winget-cli.ps1 -Architectures @('x64') -Force + + - name: Save WinGet CLI cache + if: steps.winget-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: src/UniGetUI.PackageEngine.Managers.WinGet/winget-cli_x64 + key: ${{ steps.winget-cache.outputs.cache-primary-key }} + - name: Install dependencies working-directory: src run: dotnet restore UniGetUI.sln @@ -64,5 +86,7 @@ jobs: - name: Run Tests working-directory: src + env: + GITHUB_TOKEN: ${{ github.token }} run: dotnet test UniGetUI.sln --no-restore --verbosity q --nologo