多级gitlab矩阵管道
我正在开发一个管道自动生成 C++ conan 包,下面的矩阵构建基于该项目的管道 https://github.com/aminya/setup-cpp。
build:
stage: build
parallel:
matrix:
- os: ubuntu:20.04
compiler: [llvm, gcc]
build_type: [Debug, Release, MinSizeRel, RelWithDebInfo]
variables:
compiler: ${compiler}
build_type: ${build_type}
image: ${os}
script:
- *setup_linux
- *setup_cpp
- *build
上面的代码有效并创建了 8 个成功执行的作业。
我希望每个构建都作为单独的作业运行一个测试步骤,就像
test:
stage: test
script:
- *test
- -> if [${build_type} == "Debug"] *code_coverage
artifact:
when: always
reports:
junit: /build/test/*xml
cobertura: build/coverage.xml
矩阵构建中的每个构建都可以继续到一个附加阶段吗?它们都是在构建阶段作为附加脚本添加的吗?
script:
- *setup_linux
- *setup_cpp
- *build
- *test
- *package
- *upload
- *etc....
I am working on a pipeline auto generate c++ conan packages, the matrix build below is based on the pipeline from this project https://github.com/aminya/setup-cpp.
build:
stage: build
parallel:
matrix:
- os: ubuntu:20.04
compiler: [llvm, gcc]
build_type: [Debug, Release, MinSizeRel, RelWithDebInfo]
variables:
compiler: ${compiler}
build_type: ${build_type}
image: ${os}
script:
- *setup_linux
- *setup_cpp
- *build
the above works and creates 8 jobs that execute successfully.
What i would like is for each build to run a test step as a separate job like such
test:
stage: test
script:
- *test
- -> if [${build_type} == "Debug"] *code_coverage
artifact:
when: always
reports:
junit: /build/test/*xml
cobertura: build/coverage.xml
is it possible for each build in the matrix build to follow on to an additional stage? do they all just get added as an additional script in the build stage?
script:
- *setup_linux
- *setup_cpp
- *build
- *test
- *package
- *upload
- *etc....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论