Skip to content

Commit

Permalink
Upstream-Check optimiert (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Mar 26, 2024
1 parent 7889620 commit 12a2c0d
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions .github/workflows/upstream-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [ opened, synchronize, reopened, ready_for_review ]

jobs:
upstream_run:
run:
name: ${{ matrix.repo }}@${{ matrix.branch }}
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down Expand Up @@ -34,30 +34,26 @@ jobs:
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.branch }}

- name: Setup PHP
uses: shivammathur/setup-php@73963f5001e335723c998e4a0125ce060083985c # v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: set redaxo/php-cs-fixer-config to current branch
run: composer require redaxo/php-cs-fixer-config:dev-${{ github.head_ref }} --no-scripts --no-update --dev

- name: allow php-cs-fixer version required by redaxo/php-cs-fixer-config
run: composer require friendsofphp/php-cs-fixer:\* --no-scripts --no-update --dev

- uses: ramsey/composer-install@v3
if: hashFiles('composer.lock') != ''
with:
dependency-versions: 'highest' # to trigger 'composer update' instead of 'composer install' but limited to redaxo/php-cs-fixer-config updates only
composer-options: 'redaxo/php-cs-fixer-config --prefer-dist --no-progress --with-all-dependencies'

- uses: ramsey/composer-install@v3
if: hashFiles('composer.lock') == ''

- name: Set redaxo/php-cs-fixer-config to main branch
run: composer require redaxo/php-cs-fixer-config:dev-main friendsofphp/php-cs-fixer:\* --dev --no-scripts --no-interaction --no-update --ansi

- uses: ramsey/composer-install@0f18aec461938c57720faaf2dba4421bf698cf42 # v3
with:
dependency-versions: 'highest' # to trigger 'composer update'
composer-options: '--prefer-dist --no-progress --with-all-dependencies'

- name: run php-cs-fixer
run: vendor/bin/php-cs-fixer check -v --ansi --diff || exit 0
dependency-versions: 'highest' # to trigger 'composer update' instead of 'composer install'
composer-options: ${{ hashFiles('composer.lock') != '' && 'redaxo/php-cs-fixer-config' || '' }} --with-all-dependencies

- name: Run php-cs-fixer with config from main branch
run: vendor/bin/php-cs-fixer fix -v --ansi --diff || exit 0

- name: Set redaxo/php-cs-fixer-config to current branch
run: composer require redaxo/php-cs-fixer-config:dev-${{ github.head_ref }} --dev --with-all-dependencies --no-scripts --no-interaction --no-progress --ansi

- name: Run php-cs-fixer
run: vendor/bin/php-cs-fixer check -v --ansi --diff || echo "::warning file=src/Config.php::New changes in ${{ matrix.repo }}@${{ matrix.branch }}."

0 comments on commit 12a2c0d

Please sign in to comment.