Skip to content

Commit 901d01a

Browse files
committed
chore: attempt to fix broken database connection in CI tests
1 parent 9ea973f commit 901d01a

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

.env.ci-tests

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
APP_NAME=TalentPulse
2-
APP_ENV=local
2+
APP_ENV=testing
33
APP_KEY=base64:xc00huj08Ru0P59Os7q/ceqOlcjasFfugAMWs0L0pDM=
44
APP_DEBUG=true
55
APP_URL=https://api.talentpulse.localhost

.github/workflows/ci.yml

+2-17
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
build-tests:
1111
runs-on: ubuntu-latest
1212

13-
# Docs: https://docs.github.com/en/actions/using-containerized-services
1413
services:
1514
mysql:
1615
image: mysql:8.0
@@ -19,7 +18,7 @@ jobs:
1918
MYSQL_ROOT_PASSWORD: password
2019
MYSQL_DATABASE: talentpulse
2120
ports:
22-
- 3306/tcp
21+
- 3306:3306
2322
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2423

2524
redis:
@@ -40,11 +39,6 @@ jobs:
4039
extensions: mbstring, dom, fileinfo, mysql
4140
coverage: xdebug
4241

43-
# Local MySQL service in GitHub hosted environments is disabled by default.
44-
# If you are using it instead of service containers, make sure you start it.
45-
# - name: Start mysql service
46-
# run: sudo systemctl start mysql.service
47-
4842
- name: Get composer cache directory
4943
id: composer-cache
5044
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
@@ -66,22 +60,13 @@ jobs:
6660
- name: Clear Config
6761
run: php artisan config:clear
6862

69-
# - name: Run Migration
70-
# run: php artisan migrate -v
71-
# env:
72-
# DB_PORT: ${{ job.services.mysql.ports['3306'] }}
73-
# REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
74-
7563
- name: Test code style pint
7664
run: composer run pint-test
7765

7866
- name: Test with phpunit
7967
run: composer run tests:coverage
80-
env:
81-
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
82-
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
8368

84-
- name: Static analyses with Larastan (PHPStan)
69+
- name: Static code analyses with Larastan (PHPStan)
8570
run: composer run analyse
8671
continue-on-error: true
8772

phpunit.xml

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@
1818
</include>
1919
</source>
2020
<php>
21-
<env name="APP_ENV" value="local-tests"/>
21+
<env name="APP_ENV" value="testing"/>
2222
<env name="BCRYPT_ROUNDS" value="4"/>
2323
<env name="CACHE_DRIVER" value="array"/>
24-
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
25-
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
2624
<env name="MAIL_MAILER" value="array"/>
2725
<env name="QUEUE_CONNECTION" value="sync"/>
2826
<env name="SESSION_DRIVER" value="array"/>
29-
<env name="TELESCOPE_ENABLED" value="false"/>
3027
</php>
3128
</phpunit>

0 commit comments

Comments
 (0)