Skip to content

Commit d0ce46c

Browse files
authored
Merge pull request #66 from phiHero/master
run test in github actions on push, pr
2 parents 3353573 + 546ef3b commit d0ce46c

3 files changed

Lines changed: 50 additions & 5 deletions

File tree

.github/workflows/tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Run tests with PHP v8.3
8+
runs-on: ubuntu-latest
9+
services:
10+
typesense:
11+
image: typesense/typesense:26.0
12+
ports:
13+
- 8108:8108/tcp
14+
volumes:
15+
- /tmp/typesense-server-data:/data
16+
env:
17+
TYPESENSE_DATA_DIR: /data
18+
TYPESENSE_API_KEY: xyz
19+
TYPESENSE_ENABLE_CORS: true
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup PHP 8.3
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: '8.3'
26+
coverage: xdebug
27+
- uses: php-actions/composer@v6
28+
- name: Run tests
29+
run: vendor/bin/phpunit --coverage-text

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
"preferred-install": {
5757
"*": "dist"
5858
},
59-
"sort-packages": true
59+
"allow-plugins": {
60+
"php-http/discovery": true
61+
}
6062
},
6163
"scripts": {
6264
"typesenseServer": [

phpunit.xml.dist

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
columns="max"
8+
displayDetailsOnTestsThatTriggerWarnings="true"
9+
failOnDeprecation="true"
10+
failOnWarning="true"
11+
failOnNotice="true"
12+
failOnRisky="true"
513
>
614
<testsuites>
715
<testsuite name="feature">
816
<directory>tests/Feature</directory>
917
</testsuite>
1018
</testsuites>
1119

20+
<source>
21+
<include>
22+
<directory>src</directory>
23+
</include>
24+
</source>
25+
1226
<php>
13-
<env name="TYPESENSE_NODE_HOST" value="host.docker.internal" />
27+
<env name="TYPESENSE_NODE_HOST" value="localhost" />
1428
<env name="TYPESENSE_NODE_PORT" value="8108" />
1529
<env name="TYPESENSE_NODE_PROTOCOL" value="http" />
1630
<env name="TYPESENSE_API_KEY" value="xyz" />
1731
</php>
18-
</phpunit>
32+
</phpunit>

0 commit comments

Comments
 (0)