Skip to content

Commit

Permalink
chore: add tests to demo FOR FUN (#14)
Browse files Browse the repository at this point in the history
This PR uncovers the issue in demo.
  • Loading branch information
Ferror authored Jan 29, 2024
1 parent 15cfcc8 commit fb68121
Show file tree
Hide file tree
Showing 8 changed files with 2,222 additions and 171 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push: ~
pull_request: ~
workflow_dispatch: ~

jobs:
demo:
runs-on: ubuntu-latest
name: CI Demo - PHP ${{ matrix.php }}
strategy:
matrix:
php: [8.2, 8.3]

steps:
- # Copies the repository files to the Action Runner
name: Checkout Repository
uses: actions/checkout@v4

- # Installs PHP and other necessary tools
name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}

- # Installs and caches PHP dependencies
name: Install Dependencies
uses: ramsey/[email protected]
with:
working-directory: example

- # Validates composer.json structure and required fields
name: Validate composer.json
run: cd example && composer validate --ansi --strict --no-check-publish

- # Runs unit and integration tests, like phpspec, phpunit etc.
name: Run Tests
run: cd example && composer test
15 changes: 14 additions & 1 deletion example/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev",
"minimum-stability": "stable",
"require": {
"php": ">=8.2",
"ferror/asyncapi-doc-bundle": "dev-master",
Expand All @@ -11,6 +11,11 @@
"symfony/runtime": "6.4.*",
"symfony/yaml": "6.4.*"
},
"require-dev": {
"phpunit/phpunit": "^10.5",
"symfony/phpunit-bridge": "6.4.*",
"symfony/browser-kit": "6.4.*"
},
"config": {
"allow-plugins": {
"php-http/discovery": true,
Expand All @@ -24,6 +29,11 @@
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\": "tests/"
}
},
"repositories": {
"ferror/asyncapi-doc-bundle": {
"type": "path",
Expand All @@ -47,5 +57,8 @@
"allow-contrib": false,
"require": "6.4.*"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
}
}
Loading

0 comments on commit fb68121

Please sign in to comment.