Create custom configuration for PHP Insights (some opinions included) #20
Workflow file for this run
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 checks | |
on: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
standards: | |
runs-on: ubuntu-latest | |
name: Check standards | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
- name: Cache hash | |
id: get-cache-hash | |
run: | | |
COMPOSER_HASH=`cat composer.json | sha256sum | head -c 40` | |
DATE=`date -u "+%Y%m%d"` | |
echo "hash=$COMPOSER_HASH$DATE" >> "$GITHUB_OUTPUT" | |
shell: bash | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: vendor | |
key: ${{ runner.os }}-${{steps.get-cache-hash.outputs.hash}} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: composer install --prefer-dist --no-progress | |
- name: Run phpstan tests | |
run: composer ci-phpstan | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-${{steps.get-cache-hash.outputs.hash}} |