Skip to content

Commit

Permalink
Verify MySQL connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Kaiser committed Nov 18, 2020
1 parent 1a71bbf commit c643f32
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ jobs:
MYSQL_PASSWORD: kotti
MYSQL_DATABASE: kotti
MYSQL_ROOT_PASSWORD: kotti
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
options: >-
--health-cmd="mysqladmin ping"
--health-interval=5s
--health-timeout=2s
--health-retries=3
ports:
- 3306
# Maps tcp port 3306 on service container to the host
- 3306:3306

steps:
- uses: actions/checkout@v2
Expand All @@ -45,9 +50,16 @@ jobs:
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Verify MySQL connection
env:
PORT: ${{ job.services.mysql.ports[3306] }}
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
sleep 1
done
- name: Test with pytest
run: |
pytest
env:
KOTTI_TEST_DB_STRING: mysql://kotti:kotti@localhost:3306/kotti
KOTTI_TEST_DB_STRING: mysql://kotti:kotti@127.0.0.1:3306/kotti

0 comments on commit c643f32

Please sign in to comment.