我在构建和测试阶段使用powershell和msbuild。
测试阶段的配置如下:
test:
stage: test
artifacts:
when: always
name: "${CI_BUILD_STAGE}_${CI_BUILD_REF_NAME}"
expire_in: 1 week
paths:
- TestResults/
dependencies:
- build
script:
- ./.gitlab-ci/Test.ps1
tags:
- powershell
- msbuild
成功运行测试(Test.ps1返回0)后,它会按原样上传工件:
Uploading artifacts...
TestResults/: found 15 matching files
Uploading artifacts to coordinator... ok
Build succeeded
然而,如果测试运行失败,它就会失败,并且不会上传任何内容:
ERROR: Build failed: exit status 1
解决
由于cascaval建议我必须更新跑步者。