Skip to content

Commit

Permalink
ci: run tests on push, pr
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenhoang committed Jun 18, 2024
1 parent 3353573 commit c53f965
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: tests

on: [push]

jobs:
build_and_test:
runs-on: ubuntu-latest
services:
typesense:
image: typesense/typesense:26.0
ports:
- 8108:8108/tcp
volumes:
- /tmp/typesense-server-data:/data
env:
TYPESENSE_DATA_DIR: /data
TYPESENSE_API_KEY: xyz
TYPESENSE_ENABLE_CORS: true
steps:
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
- run: vendor/bin/phpunit
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
"preferred-install": {
"*": "dist"
},
"sort-packages": true
"allow-plugins": {
"php-http/discovery": true
}
},
"scripts": {
"typesenseServer": [
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</testsuites>

<php>
<env name="TYPESENSE_NODE_HOST" value="host.docker.internal" />
<env name="TYPESENSE_NODE_HOST" value="localhost" />
<env name="TYPESENSE_NODE_PORT" value="8108" />
<env name="TYPESENSE_NODE_PROTOCOL" value="http" />
<env name="TYPESENSE_API_KEY" value="xyz" />
Expand Down

0 comments on commit c53f965

Please sign in to comment.