#151 - Update cache key #469
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: "Validations" | |
on: [push] | |
jobs: | |
validate-code-style: | |
name: PSR-12 Code style | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: composer validate | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install PHP_CodeSniffer composer package | |
run: composer global require "squizlabs/php_codesniffer=*" | |
- name: Validate PSR-12 Code Style | |
run: ~/.composer/vendor/bin/phpcs | |
validate-code-static: | |
name: Static Code with PHP ${{ matrix.php-versions }} | |
runs-on: ubuntu-latest | |
env: | |
extensions: mbstring, intl, json, phalcon-5.5.0 | |
key: cache-v4.0~13.04.2024 | |
needs: validate-code-style | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: ['8.0', '8.1', '8.2', '8.3'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup cache environment | |
id: cache-env | |
uses: shivammathur/cache-extensions@v1 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: ${{ env.extensions }} | |
key: ${{ env.key }} | |
- name: Cache extensions | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.cache-env.outputs.dir }} | |
key: ${{ steps.cache-env.outputs.key }} | |
restore-keys: ${{ steps.cache-env.outputs.key }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: ${{ env.extensions }} | |
tools: pecl | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install Composer dependencies with PHPStan | |
run: composer require --prefer-dist --no-progress --no-suggest --dev phpstan/phpstan | |
- name: Run Psalm | |
if: always() | |
run: vendor/bin/psalm --show-info=false | |
- name: Run PHPStan | |
if: always() | |
run: vendor/bin/phpstan analyse -l 5 src |