Skip to content

Commit 991a707

Browse files
committed
testing with github actions
1 parent aae8a4f commit 991a707

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: test
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php: ['8.1', '8.2']
11+
services:
12+
db:
13+
image: mysql:8.0.23
14+
ports:
15+
- 3306:3306
16+
env:
17+
MYSQL_DATABASE: spatial_test
18+
MYSQL_ROOT_PASSWORD: password
19+
name: Test PHP ${{ matrix.php }}
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up php ${{ matrix.php }}
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
tools: composer:v2
28+
extensions: mbstring, dom, fileinfo, pdo, pcntl
29+
coverage: none
30+
- run: composer install
31+
- name: run test
32+
run: vendor/bin/phpunit

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ start_db:
1010
-p 3306:3306 \
1111
-v $(DB_DIR):/var/lib/mysql \
1212
-e MYSQL_DATABASE=spatial_test \
13-
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
13+
-e MYSQL_ROOT_PASSWORD=password \
1414
mysql:$(V) --character-set-server=utf8 --collation-server=utf8_general_ci --default-authentication-plugin=mysql_native_password
1515

1616
start_db_maria:
@@ -19,7 +19,7 @@ start_db_maria:
1919
-p 3306:3306 \
2020
-v $(DB_DIR):/var/lib/mysql \
2121
-e MYSQL_DATABASE=spatial_test \
22-
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
22+
-e MYSQL_ROOT_PASSWORD=password \
2323
mariadb:$(mV) --character-set-server=utf8 --collation-server=utf8_general_ci --default-authentication-plugin=mysql_native_password
2424

2525

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
<env name="DB_HOST" value="127.0.0.1"/>
3333
<env name="DB_PORT" value="3306"/>
3434
<env name="DB_USERNAME" value="root"/>
35-
<env name="DB_PASSWORD" value=""/>
35+
<env name="DB_PASSWORD" value="password"/>
3636
</php>
3737
</phpunit>

0 commit comments

Comments
 (0)