Skip to content

Update actions

Update actions #78

name: Upstream
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
jobs:
run:
name: ${{ matrix.repo }}@${{ matrix.branch }}
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.event.pull_request.draft == false
concurrency:
group: upstream-check-${{github.event_name}}-${{ matrix.repo }}-${{ matrix.branch }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include:
- repo: redaxo/redaxo
branch: main
php: '8.1'
- repo: redaxo/redaxo
branch: 6.x
php: '8.3'
- repo: yakamara/yform
branch: master
php: '8.1'
steps:
- name: Checkout ${{ matrix.repo }}@${{ matrix.branch }}
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.branch }}
- name: Setup PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
with:
php-version: ${{ matrix.php }}
coverage: none
- 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@v3
with:
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 }}."