问题描述
Github Actions工作流中是否有MSTest.exe YAML等效项?
如果有一个获取示例Yaml,其中包含/testcontainer
,/category
和/resultsfile
的样子?
我能够找到MSBuild。不知道是否可以使用MsBuild来运行MSTest,然后使用上面的示例也可以解决我的问题。
当前工作流程yaml
name: MS Test Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: MSTest
shell: powershell
run: '& "$(vswhere -property installationPath)\Common7\IDE\MSTest.exe" /testcontainer:Test.dll /resultsfile:TestResults.trx'
编辑:已更新了半工作解决方案。
解决方法
由于您拥有msbuild,因此您还应该能够运行mstest:
<a href="{% url 'download' %}" class="btn btn-fill wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.4s">Downlaod <i class="fa fa-download"></i></a>
Here you have info how to use msttest
,有效的解决方案。仍在寻找改进,但这会起作用
name: MS Test Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: MSTest
shell: powershell
run: '& "$(vswhere -property installationPath)\Common7\IDE\MSTest.exe" /testcontainer:Test.dll /resultsfile:TestResults.trx'