Do not pollute logs #12
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: static-analysis | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
psalm: | |
name: Psalm | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
ini-values: memory_limit=-1, max_execution_time=-1, post_max_size=256M | |
tools: vimeo/psalm | |
coverage: none | |
- name: Get Composer config | |
id: composer-config | |
shell: bash | |
run: | | |
echo "BIN_DIR=$(composer config home)/vendor/bin" >> $GITHUB_OUTPUT | |
echo "CACHE_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer | |
id: cache-composer | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}:php-8.1:composer | |
path: | | |
${{ steps.composer-config.outputs.BIN_DIR }} | |
${{ steps.composer-config.outputs.CACHE_DIR }} | |
- name: Cache vendor | |
id: cache-vendor | |
uses: actions/cache@v3 | |
with: | |
# Use composer.json for key as composer.lock is not committed. | |
key: ${{ runner.os }}:php-8.1:vendor-${{ hashFiles('**/composer.json') }} | |
path: vendor | |
restore-keys: | | |
${{ runner.os }}:php-8.1:vendor-${{ hashFiles('**/composer.json') }} | |
${{ runner.os }}:php-8.1:vendor- | |
- name: Install composer dependencies | |
run: composer install --ansi --no-progress --optimize-autoloader | |
- name: Psalm | |
run: | | |
psalm --no-progress || psalm --output-format=github --no-progress |