Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add tests to demo FOR FUN #14

Merged
merged 11 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading