|
21 | 21 | jobs: |
22 | 22 | test-codebase: |
23 | 23 | runs-on: windows-latest |
| 24 | + env: |
| 25 | + NUGET_PACKAGES: ${{ github.workspace }}\.nuget\packages |
24 | 26 |
|
25 | 27 | steps: |
26 | 28 | - name: Checkout the repository |
27 | 29 | uses: actions/checkout@v6 |
28 | 30 | with: |
29 | 31 | fetch-depth: 0 |
30 | 32 |
|
31 | | - # Install the .NET Core workload |
32 | 33 | - name: Install .NET Core |
33 | 34 | uses: actions/setup-dotnet@v5 |
34 | 35 | with: |
35 | 36 | dotnet-version: 8.0.x |
36 | 37 |
|
37 | | - - name: Install Windows SDK UAP platform |
38 | | - shell: pwsh |
39 | | - run: | |
40 | | - # CsWinRT in WindowsPackageManager.Interop requires UAP 10.0.19041.0 platform metadata |
41 | | - $VsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" |
42 | | - $VsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe" |
43 | | - $InstallPath = & $VsWhere -latest -property installationPath |
44 | | - & $VsInstaller modify --installPath $InstallPath ` |
45 | | - --add Microsoft.VisualStudio.Component.UWP.Support ` |
46 | | - --add Microsoft.VisualStudio.Component.Windows10SDK.19041 ` |
47 | | - --quiet --norestart --nocache | Out-Default |
48 | | - Write-Host "Windows SDK UAP platform installed" |
49 | | -
|
50 | | - # - name: Install WinGet |
51 | | - # uses: Cyberboss/install-winget@v1 |
| 38 | + - name: Cache NuGet packages |
| 39 | + uses: actions/cache@v4 |
| 40 | + with: |
| 41 | + path: ${{ env.NUGET_PACKAGES }} |
| 42 | + key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj', 'src/**/*.props', 'src/**/*.targets', 'src/**/*.sln') }} |
| 43 | + restore-keys: | |
| 44 | + ${{ runner.os }}-nuget- |
52 | 45 |
|
53 | 46 | - name: Install dependencies |
54 | 47 | working-directory: src |
55 | 48 | run: dotnet restore UniGetUI.sln |
56 | 49 |
|
57 | | - # - name: Test build |
58 | | - # working-directory: src |
59 | | - # run: dotnet build --configuration Release |
60 | | - |
61 | 50 | - name: Run Tests |
62 | 51 | working-directory: src |
63 | 52 | run: dotnet test UniGetUI.sln --no-restore --verbosity q --nologo |
|
0 commit comments