try installing and restoring on D drive #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DotNet | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
POWERSHELL_TELEMETRY_OPTOUT: 1 | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
name: Test | |
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 | |
with: | |
fetch-depth: 0 | |
- name: Cache NuGet packages | |
if: matrix.cache | |
uses: actions/cache@v4 | |
with: | |
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: | |
dotnet-version: 8.0.x | |
dotnet-quality: 'preview' | |
- name: DotNet restore | |
run: | | |
dotnet new nugetconfig | |
dotnet restore -v n |