From d7b4141dec208030b4fd57375b88164258bbf3ef Mon Sep 17 00:00:00 2001 From: Joseph Petersen Date: Mon, 9 Dec 2024 08:38:29 +0100 Subject: [PATCH] try installing and restoring on D drive --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdadc36..d3c94a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true POWERSHELL_TELEMETRY_OPTOUT: 1 - NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages jobs: build: @@ -21,8 +20,22 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-2019, windows-2022] + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages + include: + - os: windows-2019 + DOTNET_INSTALL_DIR: D:\dotnet + NUGET_PACKAGES: D:\nuget\packages + - os: windows-2022 + DOTNET_INSTALL_DIR: D:\dotnet + NUGET_PACKAGES: D:\nuget\packages + - os: windows-2019 + DOTNET_INSTALL_DIR: '' + - os: windows-2022 + DOTNET_INSTALL_DIR: '' cache: [true, false] fail-fast: false + env: + NUGET_PACKAGES: ${{ matrix.NUGET_PACKAGES }} steps: - name: Checkout uses: actions/checkout@v4 @@ -33,10 +46,15 @@ jobs: if: matrix.cache uses: actions/cache@v4 with: - path: ${{ github.workspace }}/.nuget/packages + path: ${{ matrix.NUGET_PACKAGES }} key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} restore-keys: ${{ runner.os }}-nuget- + - name: Set Windows Environment Variables + if: startsWith(matrix.os, 'windows') && matrix.DOTNET_INSTALL_DIR != '' + shell: pwsh + run: echo "DOTNET_INSTALL_DIR=${{ matrix.DOTNET_INSTALL_DIR }}" >> $ENV:GITHUB_ENV + - name: Setup DotNet 8 uses: actions/setup-dotnet@v4 with: