name: Build

on:
  push:
    branches-ignore:
      - "dependabot/**"
    tags-ignore:
      - "*.*"
    paths-ignore:
      - "*.md"
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-latest, ubuntu-latest, macos-latest]

    steps:
      - uses: actions/checkout@v2.3.4
        with:
          fetch-depth: 0
      - name: Setup .NET Core 2.1
        uses: actions/setup-dotnet@v1.7.2
        with:
          dotnet-version: 2.1.806
      - name: Setup .NET Core 3.1
        uses: actions/setup-dotnet@v1.7.2
        with:
          dotnet-version: 3.1.300
      - name: .net SxS Unix
        if: matrix.os != 'windows-latest'
        run: rsync -a ${DOTNET_ROOT/3.1.300/2.1.806}/* $DOTNET_ROOT/
      - name: .net Sxs Windows
        if: matrix.os == 'windows-latest'
        run: |
          SET DOTNET_31_ROOT=%DOTNET_ROOT:3.1.300=2.1.806%
          xcopy /s /y /d %DOTNET_31_ROOT% %DOTNET_ROOT%
        shell: cmd
      - name: Build with cake
        uses: cake-build/cake-action@v1.2.0
        with:
          script-path: setup.cake
          target: CI
          verbosity: Diagnostic
          cake-version: 0.38.1
          cake-bootstrap: true

name: Build

on:
  push:
    branches-ignore:
      - "dependabot/**"
    tags-ignore:
      - "*.*"
    paths-ignore:
      - "*.md"
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-latest, ubuntu-latest, macos-latest]

    steps:
      - uses: actions/checkout@v2.3.4
        with:
          fetch-depth: 0
      - name: Setup .NET Core 2.1
        uses: actions/setup-dotnet@v1.7.2
        with:
          dotnet-version: 2.1.806
      - name: Setup .NET Core 3.1
        uses: actions/setup-dotnet@v1.7.2
        with:
          dotnet-version: 3.1.300
      - name: Build with cake
        uses: cake-build/cake-action@v1.2.0
        with:
          script-path: setup.cake
          target: CI
          verbosity: Diagnostic
          cake-version: 0.38.1
          cake-bootstrap: true

Remove GitHub action .NET Core side by side hacks
Remove GitHub action .NET Core side by side hacks

It is causing this error:

```
Run SET DOTNET_31_ROOT=%DOTNET_ROOT:3.1.300=2.1.806%
  SET DOTNET_31_ROOT=%DOTNET_ROOT:3.1.300=2.1.806%
  xcopy /s /y /d %DOTNET_31_ROOT% %DOTNET_ROOT%
  shell: C:\windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "{0}""
  env:
    DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
Cannot perform a cyclic copy
0 File(s) copied
Error: Process completed with exit code 4.
```

Moreover, this workaround should no longer be required, see https://github.com/actions/setup-dotnet/issues/25