如何在 GitHub Actions 中使用 mstest?

4

尝试在 Github Actions 中指定 mstest 的位置:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\MSTest.exe"。

但是提示无法找到该路径,因为它不存在。

1个回答

3
你的流水线是否使用了Setup Msbuild任务?
以下是一个用于显示MsTest帮助文档的流水线示例:
name: Display MsTest helper

on:
  push:
    branches:
      - '**' 

jobs:
  build:
    runs-on: windows-latest

    steps:
      - name: setup-msbuild
        uses: microsoft/setup-msbuild@v1

      - name: Run a one-line script
        run:  '& "$(vswhere -property installationPath)\Common7\IDE\MSTest.exe" /help'

1
这是在解析变量名后调用命令。您可以在此处阅读更多信息:https://dev59.com/sGEh5IYBdhLWcg3wvVl4 - Lucas

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接