gpt4 book ai didi

c# - 在 C# 中使用 GitLabCI

转载 作者:太空狗 更新时间:2023-10-29 23:50:15 24 4
gpt4 key购买 nike

我一直在开发 C# 应用程序,想试用 GitLab CI。我只能看到 Ruby,但找不到有关如何使用它构建 C# 应用程序的任何信息。

当我运行测试设置时,我进行了提交,但我没有构建。

Enter image description here

我应该如何进行简单构建?我可以使用哪个命令?我不介意构建失败(但构建失败)。

最佳答案

我只是想分享我的 .gitlab-ci.yml 完成单元测试。您将不得不调整您的 nuget 和可能的其他路径。这是针对同名解决方案中的单个项目。

variables:
PROJECT_NAME: "ProjectNameGoesHere"
before_script:
- echo "starting build for %PROJECT_NAME%"
- echo "Restoring NuGet Packages..."
- d:\tools\nuget restore "%PROJECT_NAME%.sln"
stages:
- build
- test
build:
stage: build
script:
- echo "Release build..."
- '"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe" /consoleloggerparameters:ErrorsOnly /maxcpucount /nologo /property:Configuration=Release /verbosity:quiet "%PROJECT_NAME%.sln"'
artifacts:
untracked: true
test:
stage: test
script:
- echo "starting tests"
- cd %PROJECT_NAME%Tests/bin/Release
- '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe" /testcontainer:%PROJECT_NAME%Tests.dll'
dependencies:
- build

关于c# - 在 C# 中使用 GitLabCI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32821281/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com