#Github Action: Module Not Found

1 messages · Page 1 of 1 (latest)

tall cloud
#
# .github/workflows/dagger.yaml

name: dagger
on:
  push:
    branches:

jobs:
  hello:
    name: hello
    runs-on: ubuntu-latest
    steps:
      - name: Call Dagger Function
        uses: dagger/dagger-for-github@8.0.0
        with:
          args: phpunit
          # assumes the Dagger Cloud token is in
          # a repository secret named DAGGER_CLOUD_TOKEN
          # set via the GitHub UI/CLI
          cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}

Running dagger call phpunit works locally, but not in the action:

12  : load module: .
13  : ┆ finding module configuration
13  : ┆ finding module configuration DONE [0.2s]
12  : load module: . ERROR [0.2s]
12  : ! module not found

Possibly useful information:

  • The main branch does not have the dagger module set up.
  • The PR adds the dagger module as well as the workflow.
    (This is being done for teaching/demo purposes which is why both are being added at the same time)
deep sky
#

you need to do a checkout step first

#

that, or, you need to specify module: in the args to point to your repo

#

then dagger will clone it for you

tall cloud
zealous delta
#

I recommend trying the module: option. Both options work, but this one will make your CI config smaller, and will avoid unnecessary data transfers

tall cloud
#

I can make it public if I need to, but only if I need to.

zealous delta
#

it should work fine with private repos, as long as the corresponding git configuration is available on the CI runner

#

you can test locally with dagger -m <MODULE>.

#

If shelling out to git clone works in any given environment, then so should dagger -m which is what that module: field uses under the hood

tall cloud
#

Right, yeah I see I'm getting the same error both sides (local remote parity 🎉 ).

For now, I'm going to get the CI pipeline working. Then I'll dig into getting module to work as it would be nice to provide the cleanest solution. 👍

tall cloud
#

Possibly slightly outdated usage in docs: https://docs.dagger.io/ci/integrations/github-actions/

Recommends using run: to use Dagger Shell syntax, but that produces this warning:

Warning: Unexpected input(s) 'run', valid inputs are ['version', 'commit', 'dagger-flags', 'verb', 'workdir', 'cloud-token', 'module', 'args', 'engine-stop', 'call']

Looks like it should be recommending using verb: run with args:

Dagger provides a GitHub Action that can be used in any GitHub Actions workflow to call one or more Dagger Functions on specific events, such as a new commit.

zealous delta
tall cloud
#

I apologise if I am, Github Actions are also new to me so I may be confusing keywords here

zealous delta
zealous delta
tall cloud
#

So without a uses statement, is it getting the shell from the previous step?

#

Sorry for posing non-dagger questions to you 😓

zealous delta
#

Don't worry this question is 100% relevant 🙂

#

The short version is that you can safely ignore this run: form at the moment, and focus on the other working example

#

They are just 2 different ways of achieving the same thing

#

The docs show both, not because you need to use both, but to make sure there is an example of each option