Skip to content

Commit 50d7cb2

Browse files
committed
Github Workflow: add step to check mysql connection
1 parent 5fd2527 commit 50d7cb2

File tree

3 files changed

+33
-15
lines changed

3 files changed

+33
-15
lines changed

.github/workflows/php.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,13 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
services:
13-
mysql-service:
13+
mysql:
1414
image: mysql:5.7
1515
env:
16-
MYSQL_ROOT_PASSWORD: root
17-
MYSQL_DATABASE: kalendapp_test
16+
MYSQL_ROOT_PASSWORD: password
1817
ports:
1918
- 3306
20-
options: >-
21-
--health-cmd="mysqladmin ping"
22-
--health-interval=10s
23-
--health-timeout=5s
24-
--health-retries=3
19+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2520

2621
steps:
2722
- uses: actions/checkout@v2
@@ -54,7 +49,15 @@ jobs:
5449
- name: Integration testing
5550
run: vendor/bin/phpunit --testsuite Integration
5651
env:
57-
DATABASE_HOST: localhost
52+
DATABASE_HOST: 127.0.0.1
53+
DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
54+
DATABASE_USER: root
55+
DATABASE_PASSWORD: password
5856

59-
- name: Feature test
60-
run: vendor/bin/behat
57+
- name: Feature testing
58+
run: vendor/bin/behat
59+
env:
60+
DATABASE_HOST: 127.0.0.1
61+
DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
62+
DATABASE_USER: root
63+
DATABASE_PASSWORD: password

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
/vendor/
1111
###< symfony/framework-bundle ###
1212

13-
###> friends-of-behat/symfony-extension ###
14-
/behat.yml.dist
15-
###< friends-of-behat/symfony-extension ###
16-
1713
###> phpunit/phpunit ###
1814
/phpunit.xml
1915
.phpunit.result.cache

behat.yml.dist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
default:
2+
suites:
3+
leads:
4+
paths:
5+
- ./tests/Features/Leads/
6+
contexts:
7+
- App\Tests\Shared\Infrastructure\Behat\DatabaseContext
8+
- App\Tests\Shared\Infrastructure\Behat\ApplicationContext
9+
10+
extensions:
11+
FriendsOfBehat\SymfonyExtension:
12+
kernel:
13+
class: App\Kernel
14+
bootstrap: ./tests/bootstrap.php
15+
Behat\MinkExtension:
16+
sessions:
17+
symfony:
18+
symfony: ~
19+
base_url: ''

0 commit comments

Comments
 (0)