name: dotnet

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Setup .NET Core
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: 2.1.401

      - uses: actions/cache@v2
        with:
          path: ~/.nuget/packages
          key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
          restore-keys: ${{ runner.os }}-nuget-

      - name: Install dependencies
        run: dotnet restore

      - name: Build
        run: dotnet build --configuration Release --no-restore

      - name: Test
        run: |
          dotnet test \
            . \
            --configuration Release \
            -p:CollectCoverage=true \
            -p:CoverletOutputFormat=opencover \
            -p:Exclude="[JsonLD.Test*]*"

      - name: Codecov
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
        run: bash <(curl -s https://codecov.io/bash)

name: dotnet

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Setup .NET Core
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: 2.1.401

      - uses: actions/cache@v2
        with:
          path: ~/.nuget/packages
          key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
          restore-keys: ${{ runner.os }}-nuget-

      - name: Install dependencies
        run: dotnet restore

      - name: Build
        run: dotnet build --configuration Release --no-restore

      - uses: actions/upload-artifact@v2
        with:
          name: build
          path: .

  test:
    runs-on: ubuntu-latest
    needs: build

    steps:
      - uses: actions/download-artifact@v1
        with:
          name: build

      - name: Test
        run: |
          dotnet test \
            . \
            --configuration Release \
            --no-build \
            --no-restore \
            -p:CollectCoverage=true \
            -p:CoverletOutputFormat=opencover \
            -p:Exclude="[JsonLD.Test*]*"

      - name: Codecov
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
        run: bash <(curl -s https://codecov.io/bash)

Break out tests to a separate build
Break out tests to a separate build
