I’m trying to use Github Actions with a Docker compose-like setup. I would like to use a service container to start a postgres instance, to connect to from an elixir container. The way I read the docs, this should work:
name: CI / Automated testing on: push jobs: test: name: Unit & integration tests runs-on: ubuntu-latest services: postgres: image: postgres:11 ports: - 5432:5432 env: POSTGRES_PASSWORD: supersecret container: image: elixir:1.9-slim env: MIX_ENV: test POSTGRES_PORT: 5432 POSTGRES_HOSTNAME: postgres POSTGRES_PASSWORD: supersecret steps: - name: Checkout code uses: actions/checkout@master - name: Install dependencies mix do local.hex --force, local.rebar --force, deps.get - name: Compile code (warnings as errors) run: mix compile --warnings-as-errors - name: Check code formatting run: mix format --check-formatted - name: Run tests run: mix test
But sadly it does not work. Setting POSTGRES_HOSTNAME to localhost also does not seem to work. Does anybody know how to fix the issue?