diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b696ac2c..a0185f2d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ jobs: uses: shivammathur/setup-php@v2 - name: Validate composer.json run: | - (cd src/Bundle && composer validate --strict --no-check-lock) + (cd src/Framework/Symfony && composer validate --strict --no-check-lock) tests: runs-on: ubuntu-20.04 strategy: @@ -50,16 +50,16 @@ jobs: with: php-version: ${{ matrix.php }} - run: | - sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' src/Bundle/composer.json; + sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' src/Framework/Symfony/composer.json; if: matrix.symfony - run: | composer config minimum-stability dev composer config prefer-stable true if: matrix.beta - run: | - (cd src/Bundle && composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_option }}) + (cd src/Framework/Symfony && composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_option }}) - run: | - (cd src/Bundle && vendor/bin/phpunit) + (cd src/Framework/Symfony && vendor/bin/phpunit) tests-windows: runs-on: windows-2022 strategy: @@ -95,13 +95,13 @@ jobs: with: php-version: ${{ matrix.php }} - run: | - (Get-Content composer.json) -replace '("symfony/[^"]+": )"[^"]+"', '$1"${{ matrix.symfony }}"' | Out-File -encoding ASCII src/Bundle/composer.json + (Get-Content composer.json) -replace '("symfony/[^"]+": )"[^"]+"', '$1"${{ matrix.symfony }}"' | Out-File -encoding ASCII src/Framework/Symfony/composer.json if: matrix.symfony - run: | composer config minimum-stability dev composer config prefer-stable true if: matrix.beta - run: | - {cd src/Bundle && composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_option }}} + {cd src/Framework/Symfony && composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_option }}} - run: | - {cd src/Bundle && vendor/bin/phpunit} + {cd src/Framework/Symfony && vendor/bin/phpunit} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 33956051..6f067f3b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -46,17 +46,16 @@ jobs: - knplabs/snappy path: - ./ - # include: ${{ fromJson(needs.packages.outputs.packages) }} + include: ${{ fromJson(needs.packages.outputs.packages) }} defaults: run: working-directory: ${{ matrix.path }} steps: - uses: actions/checkout@v4 - with: - sparse-checkout: | - src/Core/ - ${{ matrix.path }} - uses: shivammathur/setup-php@v2 + - name: composer patch + run: | + cat <<< $(jq '.+{repositories: [{type: "path", url: "${{ github.workspace }}/src/Core", options: { versions: { "knplabs/snappy-core": "self.version" } }}]}' < composer.json) > composer.json - name: composer install run: | composer install diff --git a/composer.json b/composer.json index fd30a2c9..47c5aaa9 100644 --- a/composer.json +++ b/composer.json @@ -1,69 +1,74 @@ { - "name": "knplabs/knp-snappy", - "description": "PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.", - "license": "MIT", - "type": "library", - "keywords": [ - "pdf", - "thumbnail", - "snapshot", - "knplabs", - "knp", - "wkhtmltopdf" - ], - "authors": [ - { - "name": "KNP Labs Team", - "homepage": "http://knplabs.com" - }, - { - "name": "Symfony Community", - "homepage": "http://github.com/KnpLabs/snappy/contributors" - } - ], - "homepage": "http://github.com/KnpLabs/snappy", - "require": { - "php": ">=8.1", - "dompdf/dompdf": "^3.0", - "psr/http-factory": "^1.1", - "psr/http-message": "^2.0", - "psr/log": "^2.0|^3.0", - "symfony/config": "^5.4|^6.4|^7.1", - "symfony/dependency-injection": "^5.4|^6.4|^7.1", - "symfony/http-client": "^5.4|^6.4|^7.1", - "symfony/http-kernel": "^5.4|^6.4|^7.1", - "symfony/process": "^5.4|^6.4|^7.1" + "name": "knplabs/knp-snappy", + "description": "PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.", + "license": "MIT", + "type": "library", + "keywords": [ + "pdf", + "thumbnail", + "snapshot", + "knplabs", + "knp", + "wkhtmltopdf" + ], + "authors": [ + { + "name": "KNP Labs Team", + "homepage": "http://knplabs.com" }, - "require-dev": { - "nyholm/psr7": "^1.8", - "phpstan/extension-installer": "^1.4", - "phpstan/phpstan": "^1.12", - "phpstan/phpstan-phpunit": "^1.4", - "phpunit/phpunit": "^11.4" - }, - "replace": { - "knplabs/snappy-bundle": "self.version", - "knplabs/snappy-core": "self.version", - "knplabs/snappy-dompdf": "self.version", - "knplabs/snappy-wkhtmltopdf": "self.version" - }, - "autoload": { - "psr-4": { - "KNPLabs\\Snappy\\Backend\\Dompdf\\": "src/Backend/Dompdf/", - "KNPLabs\\Snappy\\Backend\\WkHtmlToPdf\\": "src/Backend/WkHtmlToPdf/", - "KNPLabs\\Snappy\\Core\\": "src/Core/", - "KNPLabs\\Snappy\\Framework\\Symfony\\": "src/Framework/Symfony/" - } - }, - "config": { - "allow-plugins": { - "phpstan/extension-installer": true - }, - "sort-packages": true + { + "name": "Symfony Community", + "homepage": "http://github.com/KnpLabs/snappy/contributors" + } + ], + "homepage": "http://github.com/KnpLabs/snappy", + "require": { + "php": ">=8.1", + "dompdf/dompdf": "^3.0", + "psr/http-factory": "^1.1", + "psr/http-message": "^2.0", + "psr/log": "^2.0|^3.0", + "symfony/config": "^5.4|^6.4|^7.1", + "symfony/dependency-injection": "^5.4|^6.4|^7.1", + "symfony/http-client": "^5.4|^6.4|^7.1", + "symfony/http-kernel": "^5.4|^6.4|^7.1", + "symfony/process": "^5.4|^6.4|^7.1" + }, + "require-dev": { + "nyholm/psr7": "^1.8", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-phpunit": "^1.4", + "phpunit/phpunit": "^11.4" + }, + "replace": { + "knplabs/snappy-bundle": "self.version", + "knplabs/snappy-core": "self.version", + "knplabs/snappy-dompdf": "self.version", + "knplabs/snappy-wkhtmltopdf": "self.version" + }, + "autoload": { + "psr-4": { + "KNPLabs\\Snappy\\Backend\\Dompdf\\": "src/Backend/Dompdf/", + "KNPLabs\\Snappy\\Backend\\WkHtmlToPdf\\": "src/Backend/WkHtmlToPdf/", + "KNPLabs\\Snappy\\Core\\": "src/Core/", + "KNPLabs\\Snappy\\Framework\\Symfony\\": "src/Framework/Symfony/" + } + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true }, - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "repositories": [ + { + "url": "src/Core" } + ] }