zyborg / dotnet-tests-report

GitHub Action to run .NET Core tests and generate report attached to Workflow Run
MIT License
112 stars 36 forks source link

Support for .NET 5 #5

Closed Wndrr closed 3 years ago

Wndrr commented 3 years ago

It seems that the highest .NET runtime currently supported is .netcore3.1 How should I go about using this workflow action for a .NET 5 project ? Is there planned support for .NET 5 ?

Here is the console error:

error NETSDK1045: The current .NET SDK does not support targeting .NET Core 5.0. Either target .NET Core 3.1 or lower, or use a version of the .NET SDK that supports .NET Core 5.0. [/home/runner/work/DeepK8s/DeepK8s/UnitTests/UnitTests.csproj]

And the workflow file

[...]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run test & Generate report
        uses: zyborg/dotnet-tests-report@v1.2.0
        with:
          project_path: UnitTests
          report_name: DeepK8s - Unit Tests
          report_title: DeepK8s - Unit Tests
          github_token: ${{ secrets.GITHUB_TOKEN }}
          gist_name: deepk8s_unit_tests.md
          gist_badge_label: 'DeepK8s - Unit Tests: %Counters_passed%/%Counters_total%'
          gist_token: ${{ secrets.GIST_TOKEN }}
          set_check_status_from_test_outcome: true
ebekker commented 3 years ago

I just re-ran a previous test that was already working with a preview version of .NET 5 (Preview 7) and the test still worked, so I imagine it should work just fine for the release version of .NET 5. Are you prepping your workflow build environment with the appropriate version of .NET SDK? For example, using the setup-dotnet action, you can specify the target version of the SDK you want to install.

ebekker commented 3 years ago

Just confirmed, until next month, the stock ubuntu-latest image includes up to .NET SDK 3.1 by default, so you need to bump it up yourself. It's pby best to always use setup-dotnet to prep your environment regardless so you are not dependent on what may or may not be the default environment's state.

I'm going to close this for now, but reopen if you think there's something more that I can do.

Wndrr commented 3 years ago

Indeed ! I didn't know about setup-dotnet. Thank you for your quick response, it's working as expected now :-)