多级gitlab矩阵管道

发布于 2025-01-10 22:26:22 字数 1113 浏览 0 评论 0原文

我正在开发一个管道自动生成 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文