0.1.1 #8
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: PHP Psalm | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [ready_for_review] | |
release: | |
types: [published] | |
jobs: | |
psalm: | |
name: Psalm | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
# mtime needs to be restored for Psalm cache to work correctly | |
- name: Restore mtimes | |
uses: chetan/git-restore-mtime-action@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
coverage: none | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: | | |
echo "composer_dir={$(composer config cache-files-dir)}" >> $GITHUB_OUTPUT | |
- name: Retrieve Composer‘s cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.composer_dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install composer dependencies | |
run: "composer install --no-interaction --no-progress --no-scripts" | |
# the way cache keys are set up will always cause a cache miss | |
# but will restore the cache generated during the previous run based on partial match | |
- name: Retrieve Psalm’s cache | |
uses: actions/cache@v3 | |
with: | |
path: ./cache/psalm | |
key: ${{ runner.os }}-psalm-cache-${{ hashFiles('psalm.xml', 'psalm-baseline.xml') }} | |
- name: Run Psalm | |
run: composer psalm -- --shepherd |