-
Notifications
You must be signed in to change notification settings - Fork 231
Add MySQL example. #35
base: main
Are you sure you want to change the base?
Conversation
jrfnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While trying to get the VM version working, in my specific case, I still did not succeed unless I made the following additional changes.
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | ||
| ports: | ||
| # will assign a random free host port | ||
| - 3306/tcp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - 3306/tcp | |
| - 3306:3306 |
| # use localhost for the host here because we are running the job on the VM. | ||
| # If we were running the job on in a container this would be mysql | ||
| MYSQL_HOST: localhost | ||
| MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} # get randomly assigned published port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} # get randomly assigned published port | |
| MYSQL_PORT: 3306 |
|
@jrfnl I'd be curious to know why Maybe @andymckay or @chrispat could comment on this? |
|
@Potherca I honestly wouldn't know. I also found that using In the end, the changes I needed for this particular workflow were quite small, but the complete combi was needed to get it all working. Relevant commits: |
I thought it might be useful to have a working example for MySQL, in case folks want/need to use a different version from the installed default.
I've tried to make the code look similar to already existing examples.
The example can be seen working here: https://github.com/potherca-contrib/example-services/actions/runs/449593636
If you have any feedback, please let me know! 👍