name: NUnit Tests

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

env:
  TEST_PROJECT: Wave.Tests

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        dotnet-version: [ '8.0.x' ]

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Setup dotnet ${{ matrix.dotnet-version }}
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: ${{ matrix.dotnet-version }}
    - uses: actions/cache@v3
      with:
        path: ~/.nuget/packages
        # Look to see if there is a cache hit for the corresponding requirements file
        key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
        restore-keys: |
          ${{ runner.os }}-nuget
    - name: Install dependencies
      run: dotnet restore ${{ env.TEST_PROJECT }}
      
    - name: Test with the dotnet CLI
      run: dotnet test ${{ env.TEST_PROJECT }}
