Using GitLabCI with C#(在 C# 中使用 GitLabCI)
问题描述
我一直在开发 C# 应用程序,并想试用 GitLab CI.我只能看到 Ruby,找不到任何关于如何使用它构建 C# 应用程序的信息.
I've been working on a C# application and wanted to try the GitLab CI out. All I can see is Ruby and can't find any information on how to build a C# application using it.
当我运行测试设置时,我进行了提交,但我没有构建.
When I run the test settings, I make the commit, but I don't have my build.
我应该如何进行简单的构建?我可以使用哪个命令?我不介意构建失败(但构建).
How should I make a simple build? Which command could I use for that? I don't mind if I get a failed build (but a build).
推荐答案
我只是想分享我的 .gitlab-ci.yml 完整的单元测试.您将不得不调整您的 nuget 和可能的其他路径.这适用于同名解决方案中的单个项目.
I just wanted to share my .gitlab-ci.yml complete with unit testing. You will have to adjust your nuget and possibly other paths. This is for a single project in a solution of the same name.
variables:
PROJECT_NAME: "ProjectNameGoesHere"
before_script:
- echo "starting build for %PROJECT_NAME%"
- echo "Restoring NuGet Packages..."
- d: ools
uget restore "%PROJECT_NAME%.sln"
stages:
- build
- test
build:
stage: build
script:
- echo "Release build..."
- '"C:WindowsMicrosoft.NETFramework64v4.0.30319msbuild.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.0Common7IDEMSTest.exe" /testcontainer:%PROJECT_NAME%Tests.dll'
dependencies:
- build
这篇关于在 C# 中使用 GitLabCI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 C# 中使用 GitLabCI
基础教程推荐
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
