Skip to content

Commit fb68121

Browse files
authored
chore: add tests to demo FOR FUN (#14)
This PR uncovers the issue in demo.
1 parent 15cfcc8 commit fb68121

8 files changed

+2222
-171
lines changed

.github/workflows/demo.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push: ~
5+
pull_request: ~
6+
workflow_dispatch: ~
7+
8+
jobs:
9+
demo:
10+
runs-on: ubuntu-latest
11+
name: CI Demo - PHP ${{ matrix.php }}
12+
strategy:
13+
matrix:
14+
php: [8.2, 8.3]
15+
16+
steps:
17+
- # Copies the repository files to the Action Runner
18+
name: Checkout Repository
19+
uses: actions/checkout@v4
20+
21+
- # Installs PHP and other necessary tools
22+
name: Setup PHP
23+
uses: shivammathur/[email protected]
24+
with:
25+
php-version: ${{ matrix.php }}
26+
27+
- # Installs and caches PHP dependencies
28+
name: Install Dependencies
29+
uses: ramsey/[email protected]
30+
with:
31+
working-directory: example
32+
33+
- # Validates composer.json structure and required fields
34+
name: Validate composer.json
35+
run: cd example && composer validate --ansi --strict --no-check-publish
36+
37+
- # Runs unit and integration tests, like phpspec, phpunit etc.
38+
name: Run Tests
39+
run: cd example && composer test

example/composer.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "project",
33
"license": "proprietary",
4-
"minimum-stability": "dev",
4+
"minimum-stability": "stable",
55
"require": {
66
"php": ">=8.2",
77
"ferror/asyncapi-doc-bundle": "dev-master",
@@ -11,6 +11,11 @@
1111
"symfony/runtime": "6.4.*",
1212
"symfony/yaml": "6.4.*"
1313
},
14+
"require-dev": {
15+
"phpunit/phpunit": "^10.5",
16+
"symfony/phpunit-bridge": "6.4.*",
17+
"symfony/browser-kit": "6.4.*"
18+
},
1419
"config": {
1520
"allow-plugins": {
1621
"php-http/discovery": true,
@@ -24,6 +29,11 @@
2429
"App\\": "src/"
2530
}
2631
},
32+
"autoload-dev": {
33+
"psr-4": {
34+
"App\\": "tests/"
35+
}
36+
},
2737
"repositories": {
2838
"ferror/asyncapi-doc-bundle": {
2939
"type": "path",
@@ -47,5 +57,8 @@
4757
"allow-contrib": false,
4858
"require": "6.4.*"
4959
}
60+
},
61+
"scripts": {
62+
"test": "vendor/bin/phpunit"
5063
}
5164
}

0 commit comments

Comments
 (0)