Skip to content

Commit

Permalink
Add psr-15 example to examples folder
Browse files Browse the repository at this point in the history
This example is broken and I don't know why (maybe somebody who knows what they are doing can explain?). But at least now we can _see_ that it is broken, which is better than just silently misleading people...
  • Loading branch information
shish committed Apr 17, 2024
1 parent 256da31 commit 5f19737
Show file tree
Hide file tree
Showing 7 changed files with 2,610 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,33 @@ jobs:
fail_ci_if_error: false # optional (default = false) - Need CODECOV_TOKEN
# Do not upload in forks, and only on php8.3, latest deps
if: ${{ github.repository == 'thecodingmachine/graphqlite' && matrix.php-version == '8.3' && matrix.install-args == '' }}

examples:
name: Check Examples
runs-on: ubuntu-latest
strategy:
matrix:
example: ['psr-15']
fail-fast: false
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"
tools: composer:v2
- name: "Install dependencies with composer"
working-directory: "examples/${{ matrix.example }}"
run: "composer --version && composer install --no-interaction --no-progress --prefer-dist"
- name: "Run example ${{ matrix.example }}"
working-directory: "examples/${{ matrix.example }}"
run: |
php -S localhost:8080 &
sleep 3
curl --silent -X POST -H "Content-Type: application/json" \
-d '{"query":"{ hello(name: \"World\") }"}' \
http://localhost:8080/graphql -o output.json
grep -q '"data":{"hello":"Hello World"}' output.json || \
(cat output.json && false)
kill %1
11 changes: 11 additions & 0 deletions examples/psr-15/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PSR-15 Integration Example
==========================

```
composer install
php -S 127.0.0.1:8080
```

```
curl -X POST -d '{"query":"{ hello(name: \"World\") }"}' -H "Content-Type: application/json" http://localhost:8080/graphql
```
31 changes: 31 additions & 0 deletions examples/psr-15/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"require": {
"thecodingmachine/graphqlite": "@dev",
"laminas/laminas-diactoros": "^2",
"laminas/laminas-stratigility": "^3",
"laminas/laminas-httphandlerrunner": "^2",
"mouf/picotainer": "^1.1",
"symfony/cache": "^4.2"
},
"repositories": [
{
"type": "path",
"url": "tmp-graphqlite",
"options": {
"symlink": true
}
}
],
"scripts": {
"symlink-package": [
"rm -rf tmp-graphqlite && ln -s -f ../../ tmp-graphqlite"
],
"pre-install-cmd": "@symlink-package",
"pre-update-cmd": "@symlink-package"
}
}

0 comments on commit 5f19737

Please sign in to comment.