Packages Components #1812
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Packages Components | |
on: | |
push: | |
branches: [ '4.0' ] | |
paths: | |
- 'src/CoreShop/Component/**' | |
pull_request: | |
branches: [ '4.0' ] | |
paths: | |
- 'src/CoreShop/Component/**' | |
release: | |
types: [ created ] | |
schedule: | |
- cron: "0 1 * * 1" | |
jobs: | |
list: | |
runs-on: ubuntu-latest | |
name: "Create a list of packages" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "List Packages" | |
id: create-list | |
run: echo "packages=$(find src/CoreShop/Component -mindepth 2 -maxdepth 2 -type f -name composer.json -exec dirname '{}' \; | sed -e 's/src\/CoreShop\///g' | sort | jq --raw-input . | jq --slurp . | jq -c .)" >> $GITHUB_OUTPUT | |
outputs: | |
packages: "${{ steps.create-list.outputs.packages }}" | |
test-packages: | |
needs: list | |
runs-on: ubuntu-latest | |
name: "${{ matrix.package }}, PHP ${{ matrix.php }}, Pimcore ${{ matrix.pimcore }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ 8.1, 8.2 ] | |
pimcore: [ ~11.1.0, ~11.2.0 ] | |
dependencies: [ highest ] | |
package: "${{ fromJson(needs.list.outputs.packages) }}" | |
exclude: | |
- php: 8.1 | |
dependencies: lowest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: intl, gd, simpleXML, dom, exif, fileinfo, iconv, mbstring, mysqli, pdo_mysql, zip, zlib | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache Composer | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php }}-package-${{ matrix.package }}-composer-${{ hashFiles(format('src/CoreShop/{0}/composer.json', matrix.package)) }} | |
restore-keys: | | |
${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.pimcore }}-package-${{ matrix.package }}-composer- | |
${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.pimcore }}-package- | |
- name: Validate composer.json | |
run: composer validate --ansi --strict | |
working-directory: "src/CoreShop/${{ matrix.package }}" | |
- if: matrix.dependencies == 'highest' | |
name: Install dependencies highest | |
run: | | |
composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update | |
composer update --no-progress --prefer-dist --optimize-autoloader | |
env: | |
COMPOSER_ROOT_VERSION: dev-master | |
working-directory: "src/CoreShop/${{ matrix.package }}" | |
- if: matrix.dependencies == 'lowest' | |
name: Install dependencies lowest | |
run: | | |
composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update | |
composer update --no-progress --prefer-dist --optimize-autoloader --prefer-lowest | |
env: | |
COMPOSER_ROOT_VERSION: dev-master | |
working-directory: "src/CoreShop/${{ matrix.package }}" | |
- name: STAN | |
run: | | |
cp ../../../../phpstan-package.neon phpstan.neon | |
vendor/bin/phpstan analyse -c phpstan.neon . -l 3 | |
working-directory: "src/CoreShop/${{ matrix.package }}" |