Kani-Maki-Gang / bld

A simple and BLAZINGLY fast CI/CD in the making
MIT License
33 stars 3 forks source link

Support for actions #251

Open kostas-vl opened 4 days ago

kostas-vl commented 4 days ago

Bld should have support for action that will be a new yaml file that list a number of steps to be executed. The feature will be similar to github actions.

To go into further detail an action file could be structured as shown below

name: An example action
type: action
version: 3

inputs:
    name: My name
    surname: My surname
    age: 100

env:
    search_engine: google

steps: 
    - echo 'Hello world'

    - name: Echo something
      sh:
          - echo 'Hello again'
          - echo 'Hello again and again'

    - name: Print something using an input
      sh: echo 'My name is ${{ inputs.name }} ${{ inputs.surname }} and I'm ${{ inputs.age }} years old'

    - name: Print something using an environment variable
      sh: echo 'I'm a user of the ${{ env.search_engine }} search engine'

    - name: Call another pipeline
      pipeline: some-dir/example-pipeline.yaml
      with:
          name: ${{ inputs.name }}
          search_engine: ${{ env.search_engine }}

    - name: Call another action
      action: actions-directory/another-action.yaml
      with:
          age: ${{ env.age }}
      env:
          name: ${{ inputs.name }}
          surname: ${{ inputs.surname }}

Based on the above example the action syntax will require:

  1. Support for inputs
  2. Support for environment variables
  3. Support for the steps keyword in order to synchronously execute a number of steps
  4. Each step can be either a shell command, an action call or a pipeline call
  5. Steps that execute shell commands can be groups under a single name