Skip to content

Reusable pipeline steps #2661

Description

@Hofer-Julian

One common problem with Rattler-Build recipes is, that you have a sequence of build steps that are duplicated across multiple recipes. GitHub actions solve this problem with reusable workflows: https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows

This issue is about adding reusable pipeline steps to recipe.yaml inspired by GitHub Action's reusable workflows.

From now on we assume that #2646 is merged. This pull request adds experimental build.steps as a structured alternative to build.script. Steps are currently anonymous and local to a single recipe. When multiple recipes follow the same build procedure, each of them has to repeat the whole sequence.

One way of describing this could be:

  • steps get a name
  • a standalone file defines a sequence of named steps together with the inputs it accepts
  • recipe.yaml references that file and sets the inputs
# cmake-steps.yaml
inputs:
  extra_args:
    default: []

steps:
  - name: configure
    run: cmake $SRC_DIR -B build ${{ inputs.extra_args | join(" ") }}
  - name: build
    run: cmake --build build
  - name: install
    run: cmake --install build --prefix $PREFIX
# recipe.yaml
build:
  steps:
    - uses: cmake-steps
      with:
        extra_args: ["-DBUILD_TESTING=ON"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions