Failing to connect to a postgres service

I’ve written a simple action that runs tests in a docker container. 

Sometimes users of the action will want to be able to connect to a database for the tests. I’ve tried this and it doesn’t work, does anyone know why?

name: On Prs
on: [pull_request]

    runs-on: ubuntu-latest

        image: postgres:11-alpine
          POSTGRES_USER: monster
          POSTGRES_PASSWORD: monster
          - "54321:5432"
        # needed because the postgres container does not provide a healthcheck
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 10

      - uses: actions/checkout@v2
      - name: "run dem tests"
        uses: Adzz/elixir_run_tests_action@v2.0.0

My app is configured correctly to listen to the correct port 54321 and it has a db password and user of monster.

Is there something obvious I am missing?

@adzz  I found your another ticket with the same question in more detail: 

Please follow on that one. Thank you for your understanding. 

1 Like