I have written a github action that runs tests in a docker container. Sometimes users of that action will want to connect to a database for the tests, I would expect they could just use a postgres service to do so, but currently I cannot get that to work.
name: On Prs on: [pull_request] jobs: run_tests: runs-on: ubuntu-latest services: postgres: image: postgres:11-alpine env: POSTGRES_USER: monster POSTGRES_PASSWORD: monster ports: - "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 steps: - uses: actions/checkout@v2 - name: "run dem tests" uses: Adzzfirstname.lastname@example.org
The app is correctly configured to listen port 54321 and the db user and password are configured correctly to both be monster. Is there something obvious I am missing??
The error is:
(DBConnection.ConnectionError) tcp connect (postgres:54321): connection refused - :econnrefused