diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..c522d5c0 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 diff --git a/composer.json b/composer.json index 1f140e87..2407692a 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,9 @@ "preferred-install": { "*": "dist" }, - "sort-packages": true + "allow-plugins": { + "php-http/discovery": true + } }, "scripts": { "typesenseServer": [ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d79f0a2e..cc66b457 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,15 @@ @@ -9,10 +17,16 @@ + + + src + + + - + - + \ No newline at end of file