-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from phiHero/master
run test in github actions on push, pr
- Loading branch information
Showing
3 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Run tests with PHP v8.3 | ||
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 | ||
- name: Setup PHP 8.3 | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.3' | ||
coverage: xdebug | ||
- uses: php-actions/composer@v6 | ||
- name: Run tests | ||
run: vendor/bin/phpunit --coverage-text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
columns="max" | ||
displayDetailsOnTestsThatTriggerWarnings="true" | ||
failOnDeprecation="true" | ||
failOnWarning="true" | ||
failOnNotice="true" | ||
failOnRisky="true" | ||
> | ||
<testsuites> | ||
<testsuite name="feature"> | ||
<directory>tests/Feature</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<source> | ||
<include> | ||
<directory>src</directory> | ||
</include> | ||
</source> | ||
|
||
<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" /> | ||
</php> | ||
</phpunit> | ||
</phpunit> |