Skip to content

Commit

Permalink
Merge pull request #15 from monofony/add-meta
Browse files Browse the repository at this point in the history
Add meta
  • Loading branch information
loic425 authored Jan 9, 2025
2 parents 77ec934 + 63c7e56 commit 827a95e
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 32 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/cqrs_pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ jobs:
${{ steps.composer-cache.outputs.dir }}
key: ${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}

- name: "Validate composer.json"
run: (cd src/Cqrs && composer validate --no-check-version)

- name: "Install dependencies"
run: (cd src/Cqrs && composer update --no-interaction --no-scripts)

- name: "Create test application"
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
(cd src/Cqrs && make create-test-application)
(cd tests/Cqrs && make create-test-application)
id: end-of-setup

- name: "Run PHPUnit"
run: (cd src/Cqrs && vendor/bin/phpunit)
run: (cd tests/Cqrs/app && vendor/bin/phpunit)
6 changes: 3 additions & 3 deletions .github/workflows/split_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
package:
- { name: 'Cqrs', path: 'cqrs-pack' }
- { path: 'pack/cqrs-pack', name: 'cqrs-pack' }
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -27,9 +27,9 @@ jobs:
- name: Split of ${{ matrix.package.name }}
uses: alphpaca/[email protected]
with:
package_path: 'src/${{ matrix.package.name }}'
package_path: 'src/${{ matrix.package.pack }}'
personal_access_token: ${{ secrets.MONOPLUS_PAT }}
git_username: 'loic425'
git_email: '[email protected]'
repository_owner: "monofony"
repository_name: "${{ matrix.package.path }}"
repository_name: "${{ matrix.package.name }}"
5 changes: 0 additions & 5 deletions src/Cqrs/.gitattributes

This file was deleted.

4 changes: 0 additions & 4 deletions src/Cqrs/.gitignore

This file was deleted.

6 changes: 6 additions & 0 deletions src/meta/cqrs-meta/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "monofony/cqrs-meta",
"type": "metapackage",
"license": "MIT",
"description": "A meta package providing recipes for CQRS"
}
5 changes: 1 addition & 4 deletions src/Cqrs/composer.json → src/pack/cqrs-pack/composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"name": "monofony/cqrs-pack",
"description": "Pack for CQRS",
"type": "meta-package",
"type": "symfony-pack",
"license": "MIT",
"require": {
"php": "^8.3",
"symfony/messenger": "*"
},
"require-dev": {
"phpunit/phpunit": "^11.4"
}
}
1 change: 1 addition & 0 deletions tests/Cqrs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app
12 changes: 6 additions & 6 deletions src/Cqrs/Makefile → tests/Cqrs/Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
TEST_APP_BASENAME=app
TEST_APP_DIR?=tests/${TEST_APP_BASENAME}
TEST_APP_DIR?=${TEST_APP_BASENAME}

.PHONY: create-test-application
create-test-application: remove-test-application install-skeleton add-requirements copy-recipe copy-tests-resources

.PHONY: remove-test-application
remove-test-application:
(cd tests && rm -rf ${TEST_APP_BASENAME})
rm -rf ${TEST_APP_BASENAME}

.PHONY: install-skeleton
install-skeleton:
(cd tests && symfony new ${TEST_APP_BASENAME})
symfony new ${TEST_APP_BASENAME}

.PHONY: add-requirements
add-requirements:
(cd ${TEST_APP_DIR} && composer require symfony/messenger)
(cd ${TEST_APP_DIR} && composer require --dev phpunit/phpunit)
(cd ${TEST_APP_BASENAME} && composer require symfony/messenger)
(cd ${TEST_APP_BASENAME} && composer require --dev phpunit/phpunit)

.PHONY: copy-recipe
copy-recipe:
cp -R ./../../monofony/cqrs-pack/0.1/* ${TEST_APP_DIR}

.PHONY: copy-tests-resources
copy-tests-resources:
cp -R tests/Resources/* ${TEST_APP_DIR}
cp -R resources/* ${TEST_APP_DIR}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/app/tests/bootstrap.php"
bootstrap="tests/bootstrap.php"
>
<php>
<ini name="display_errors" value="1" />
Expand All @@ -18,7 +18,7 @@

<testsuites>
<testsuite name="Integration Test Suite">
<directory>tests/Integration</directory>
<directory>../Integration</directory>
</testsuite>
</testsuites>

Expand Down

0 comments on commit 827a95e

Please sign in to comment.