【问题标题】:How to configure dotnet-tests-report in GitHub Actions?如何在 GitHub Actions 中配置 dotnet-tests-report?
【发布时间】:2021-05-07 05:06:10
【问题描述】:
我对 Azure Devops 有一些经验,我刚刚开始使用 GitHub Actions。
我的项目包括可以使用this action 进行测试的自动化测试。
但是,我认为我应该能够做到以下几点:
- 将测试配置为在发布模式下构建和运行。
- 如果测试失败,则使作业失败。
我发现保持简单很重要,因此我不想切换到here 描述的解决方案,因为这意味着创建多个操作并要求我的同事下载工件以查看测试结果。
我怎样才能做出这些漂亮的测试报告,但仍然能够配置它?
【问题讨论】:
标签:
unit-testing
asp.net-core
continuous-integration
github-actions
【解决方案1】:
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