#Running a Dagger Module with parallelism implemented inside a GitHub Action

1 messages · Page 1 of 1 (latest)

quiet compass
#

Hi!

I have the following code:

func (c *Ci) All(
    ctx context.Context,

    // +defaultPath="/backend"
    backendSrc *dagger.Directory,

    // +defaultPath="/backend/.golangci.yaml"
    backendConfig *dagger.File,

    // +defaultPath="/web-frontend"
    webSrc *dagger.Directory,

    // +defaultPath="/mobile-app"
    mobileSrc *dagger.Directory,
) error {
    p := pool.New().WithErrors().WithContext(ctx)

    backend := c.Backend(ctx, backendSrc, backendConfig)
    web := c.Web(ctx, webSrc)
    mobile := c.Mobile(ctx, mobileSrc)

    p.Go(backend.Lint)
    p.Go(web.Lint)
    p.Go(mobile.Lint)

    return p.Wait()
}

This lets me run all the lint checks in parallel. It works fine locally, but when I run it within my GitHub workflow, I notice that it is not running in parallel, or at least it seems like it is not.

This is the workflow:

name: Pr Verify

on:
  pull_request: {}

jobs:
  verify:
    runs-on: ubuntu-24.04

    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Call Dagger Function
      uses: dagger/dagger-for-github@v8.2.0
      with:
        version: "v0.18.8"
        module: "./dagger/ci"
        args: all

Is it already running in parallel? Or it isn't and there is a way to do it?

The logs from Dagger in a GitHub Action are not that good to see this 😅