如何在 GitHub 操作中配置 dotnet-tests-report?

How to configure dotnet-tests-report in GitHub Actions?

我有一些使用 Azure Devops 的经验,我刚刚开始使用 GitHub Actions。

我的项目包含可以使用 this action 进行测试的自动化测试。

但是,我认为我应该能够做到以下几点:

  1. 在发布模式下配置要构建和运行的测试。
  2. 如果测试失败则使作业失败。

我发现保持简单很重要,所以我不想切换到 here 中描述的解决方案,因为这将意味着创建多个操作并要求我的同事下载工件以查看测试结果。

我怎样才能做出这些漂亮的测试报告,但仍然能够配置它?

都在action definition:

中描述了
[...]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: use this action, test solution dir
        uses: zyborg/dotnet-tests-report@v1
        with:
          project_path: tests/My.Project.Tests
          report_name: my_project_tests
          report_title: My Project Tests
          github_token: ${{ secrets.GITHUB_TOKEN }}
          # If set to true, the build will fail if at least one test fails
          fail_build_on_failed_tests: true
          # the configuration passed to the msbuild process, such as `Release` or `Debug`.
          msbuild_configuration: Release