Skip to content

Commit

Permalink
wip, 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bepsvpt committed Dec 10, 2023
1 parent f91fd29 commit 48b031d
Show file tree
Hide file tree
Showing 84 changed files with 1,905 additions and 3,786 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Testing

on:
push:

jobs:
static_analyze:
name: Static Analyze

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: xdebug

- name: Get composer cache directory
run: echo "COMPOSER_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_DIR }}
key: ${{ runner.os }}-composer-static-analyze-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-static-analyze-

- name: Install dependencies
run: composer update --no-progress --no-interaction

- name: Check runtime dependencies
run: composer check-platform-reqs

- name: Run composer validate
run: composer validate --strict

- name: Run composer normalize
run: composer normalize --dry-run

- name: Run static analysis
run: vendor/bin/phpstan --memory-limit=-1 --verbose

- name: Run coding style checker
run: vendor/bin/pint -v --test

- name: Run type coverage check
run: vendor/bin/pest --type-coverage --min=95

testing:
name: PHP ${{ matrix.php }} (Testing)

runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
php: [ '8.3', '8.2' ]

services:
typesense:
image: typesense/typesense:0.25.1
ports:
- 8108:8108/tcp
volumes:
- typesense_data:/data
env:
TYPESENSE_DATA_DIR: /data
TYPESENSE_API_KEY: testing
TYPESENSE_ENABLE_CORS: true

steps:
- uses: actions/checkout@v4

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Get composer cache directory
run: echo "COMPOSER_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_DIR }}
key: ${{ runner.os }}-composer-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-php-${{ matrix.php }}-

- name: Install dependencies
run: composer update --no-progress --no-interaction

- name: Run tests
run: vendor/bin/pest --coverage --min=95
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.idea
.tmp
/composer.lock
vendor
/.fleet
/.idea
/.vscode
/coverage
/vendor
.DS_Store
.phpunit.result.cache
clover.xml
composer.phar
composer.lock
Thumbs.db
57 changes: 35 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "typesense/typesense-php",
"description": "PHP client for Typesense Search Server: https://github.com/typesense/typesense",
"type": "library",
"homepage": "https://github.com/typesense/typesense-php",
"license": "Apache-2.0",
"type": "library",
"authors": [
{
"name": "Typesense",
Expand All @@ -18,46 +17,60 @@
"role": "Developer"
}
],
"homepage": "https://github.com/typesense/typesense-php",
"support": {
"docs": "https://typesense.org/api",
"issues": "https://github.com/typesense/typesense-php/issues",
"source": "https://github.com/typesense/typesense-php",
"issues": "https://github.com/typesense/typesense-php/issues"
"docs": "https://typesense.org/docs/api"
},
"require": {
"php": "^8.2",
"php-http/discovery": "^1.19",
"psr/http-client": "^1.0",
"psr/http-client-implementation": "^1.0",
"psr/http-factory": "^1.0",
"psr/http-factory-implementation": "^1.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.40",
"guzzlehttp/guzzle": "^7.8",
"laravel/pint": "^1.13",
"pestphp/pest": "^2.28",
"pestphp/pest-plugin-faker": "^2.0",
"pestphp/pest-plugin-type-coverage": "^2.5",
"phpstan/phpstan": "^1.10",
"symfony/http-client": "^7.0"
},
"minimum-stability": "stable",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Typesense\\": "src/"
}
},
"require": {
"php": ">=7.4",
"ext-json": "*",
"monolog/monolog": "^2.1 || ^3.0 || ^3.3",
"nyholm/psr7": "^1.3",
"php-http/client-common": "^1.0 || ^2.3",
"php-http/discovery": "^1.0",
"php-http/httplug": "^1.0 || ^2.2",
"psr/http-client-implementation": "^1.0",
"psr/http-message": "^1.0 || ^2.0",
"psr/http-factory": "^1.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "3.*",
"symfony/http-client": "^5.2"
"autoload-dev": {
"psr-4": {
"Typesense\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"pestphp/pest-plugin": true,
"php-http/discovery": false
},
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"scripts": {
"lint": "phpcs -v",
"lint:fix": "phpcbf",
"typesenseServer": [
"Composer\\Config::disableProcessTimeout",
"docker-compose up"
],
"lint": "phpcs -v",
"lint:fix": "phpcbf"
]
}
}
25 changes: 14 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
version: '3.5'
version: "3.8"

services:
typesense:
image: typesense/typesense:0.21.0.rc20
environment:
TYPESENSE_DATA_DIR: /data
TYPESENSE_API_KEY: xyz
volumes:
- /tmp/typesense-server-data:/data
ports:
- 8108:8108
restart: "no"
typesense:
image: typesense/typesense:0.25.1
container_name: typesense-testing
restart: "on-failure"
ports:
- "8108:8108/tcp"
environment:
TYPESENSE_DATA_DIR: /var/tmp
TYPESENSE_API_KEY: testing
TYPESENSE_ENABLE_CORS: "true"
TYPESENSE_PEERING_ADDRESS: "127.0.0.1"
TYPESENSE_PEERING_PORT: "12345"
TYPESENSE_PEERING_SUBNET: "127.0.0.1/24"
14 changes: 0 additions & 14 deletions examples/README.md

This file was deleted.

142 changes: 0 additions & 142 deletions examples/alias_operations.php

This file was deleted.

Loading

0 comments on commit 48b031d

Please sign in to comment.