reanahub / reana

REANA: Reusable research data analysis platform
https://docs.reana.io
MIT License
123 stars 54 forks source link

Idea: consider using GHA reusable workflows #665

Open Sinclert opened 2 years ago

Sinclert commented 2 years ago

👋🏻 Hi there

GitHub Actions introduced reusable workflows at the end of last year (see their blog post), and they are a nice way to standardise workflows across repositories, when they share similar steps. I thought this project may be a good candidate for their usage, given the extremely similar set of steps, on every ci.yml workflow, of every Python based repository.

Regular workflows can be marked as reusable by adding the workflow_call keyword on their on trigger definition, and parametrised by adding the inputs and secrets keys within that trigger (example here). Then, workflows can invoke them by using the jobs.<job_name>.uses syntax, specifying a path within GitHub.com.

As an example:

name: CI

on: [push, pull_request]

jobs:
  continuous-integration:
    # Assumes a reusable workflow is defined within reanahub/github-workflows
    uses: reanahub/github-workflows/.github/workflows/ci.yml@main
    with:
      <input-1>: ...
      <input-2>: ...
tiborsimko commented 2 years ago

Hi @Sinclert, hope you are doing great! Thanks, yes it would be a nice continuation on top of the common actions that we started to use here and there.

Sinclert commented 2 years ago

Thanks! I hope you too, it has been a while 😄

Looking at the Python repositories, it seems jobs could be grouped in 4 different reusable workflows, considering the following conditions:

The job groups I have identified are:


Feel free to add / modify this list of potential reusable workflows given your preference.