Fix rebase issue #1829
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: PHPStan | |
on: | |
push: | |
paths: | |
- '**.php' | |
- composer.json | |
- tools/phpstan/composer.json | |
- ci/composer.json | |
- phpstan.ci.neon | |
- phpstan.neon.dist | |
jobs: | |
phpstan: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: ['7.4', '8.0', '8.3'] | |
prefer: ['prefer-stable', 'prefer-lowest'] | |
name: PHPStan with PHP ${{ matrix.php-versions }} ${{ matrix.prefer }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
coverage: none | |
env: | |
fail-fast: true | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}- | |
- name: Install dependencies | |
run: | | |
git clone --depth=1 https://github.com/systopia/activity-entity.git ../activity-entity && | |
git clone --depth=1 https://github.com/systopia/de.systopia.civioffice.git ../de.systopia.civioffice && | |
git clone --depth=1 https://github.com/systopia/de.systopia.remotetools.git ../de.systopia.remotetools && | |
git clone --depth=1 https://github.com/systopia/external-file.git ../external-file && | |
composer composer-phpunit -- update --no-progress --prefer-dist && | |
composer composer-phpstan -- update --no-progress --prefer-dist --optimize-autoloader && | |
# TODO: The extension's composer.json should be included in ci/composer.json. | |
# Though if it is, analyzing fails with interface not found error... | |
composer update --no-progress --prefer-dist --${{ matrix.prefer }} --optimize-autoloader && | |
(composer --working-dir=ci update --no-progress --prefer-dist --${{ matrix.prefer }} --ignore-platform-req=ext-gd; | |
# "--with-all-dependencies" necessary when update initiated after install of wikimedia/composer-merge-plugin fails | |
composer --working-dir=ci update --no-progress --prefer-dist --${{ matrix.prefer }} --with-all-dependencies --ignore-platform-req=ext-gd) | |
- name: Run PHPStan | |
run: composer phpstan -- analyse -c phpstan.ci.neon |