HowTo: Camunda-Platform-Run as service in GitHub Action

Hi,

I am trying my luck with documentation and best guesses since a few hours now. Maybe someone can help me out:

I would like to start Camunda-platform run as a service in a GitHub job. But somehow, I cannot connect inside that job to the service:

jobs:
  integrationtest:
    runs-on: ubuntu-latest
    services:
      camunda:
        image: camunda/camunda-bpm-platform:run-7.14.0
        ports:
          - 8080:8080
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.9
      uses: actions/setup-python@v2
    - name: Test with robot      
      run: |
        pip install .
        robot -d logs -b debug.log -v CAMUNDA_HOST:http://localhost:8080 tests/robot/**/*.robot

I get a Connection refused error when calling localhost:8080/engine-rest.

Do I need to wait until camunda is up? Or am I doing something wrong with GitHub actions?

Regards,
Markus

Camunda takes some time to start and listen the port. Your Python code may be executed earlier.

You could use a script to wait for it

Or maybe wait for it in robot suite setup?

Or just plain bash

while ! nc -z localhost 8080; do
  echo \"Waiting for camunda\"; sleep 2
done

but timeout is probably easier to do with either wait-for-it script or in robot.

1 Like

Yes. It turned out, that the test step had to sleep for 10 seconds.

Looks like GitHub actions can use healthchecks from docker in order to identify the service being up. But that would require the HEALTCHECK command being implemented in Camunda Dockerfile.

In the end, I switched back using Gitlab-CI. GitHub Actions are extremely inconvenient. And GitLab magically knows when Camunda is up and running.