Skip to content
Discussion options

You must be logged in to vote

@filipescaglia

First make sure mysql service starts correctly in the second step (Initialize containers)

In your env DB_HOST=127.0.0.1 is correct.

But, when you specify port on a service like this

ports:
  - 3306/tcp 

it maps port 3306 on the service container to a random free port on the host container. Then you cannot hard code a DB_PORT in your env. You have to access it using ${{ job.services.mysql.ports['3306'] }} in this case.

Please try changing these steps

- name: Run Migration
  run: php artisan migrate -v
  env:
    DB_PORT: ${{ job.services.mysql.ports['3306'] }}

and

- name: Execute tests via Pest
  run: php artisan test --parallel
  env:
    DB_PORT: ${{ job.services.mysql.por…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@filipescaglia
Comment options

@shivammathur
Comment options

Answer selected by filipescaglia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants