Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add Psalm baseline and update it automatically #40312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/psalm-baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Update psalm baseline

on:
schedule:
- cron: '0 6 1 * *'

defaults:
run:
shell: bash

jobs:
psalm:
name: Psalm baseline
runs-on: Ubuntu-20.04
strategy:
fail-fast: false
matrix:
branch: ['4.4', '5.x']

steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: "json,memcached,mongodb,redis,xsl,ldap,dom"
ini-values: "memory_limit=-1"
coverage: none

- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}

- name: Configure composer
run: |
COMPOSER_HOME="$(composer config home)"
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
echo "COMPOSER_ROOT_VERSION=$(grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV

- name: Install dependencies
run: |
echo "::group::modify composer.json"
composer remove --no-interaction --no-update symfony/phpunit-bridge
composer require psalm/phar phpunit/phpunit php-http/discovery psr/event-dispatcher --no-update
echo "::endgroup::"
echo "::group::composer update"
composer update --no-progress --ansi
git checkout composer.json
echo "::endgroup::"
./vendor/bin/psalm.phar --version

- name: Generate Psalm baseline
run: /vendor/bin/psalm.phar --set-baseline=.github/psalm/psalm.baseline.xml --no-progress

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.CARSONBOT_GITHUB_TOKEN }}
push-to-fork: carsonbot/symfony
author: carsonbot <[email protected]>
committer: carsonbot <[email protected]>
commit-message: Update psalm baseline
title: Update psalm baseline - ${{ matrix.branch }}
body: |
| Q | A
| ------------- | ---
| Branch? | ${{ matrix.branch }}
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |

The psalm baseline has changed for branch ${{ matrix.branch }}.
branch: psalm-baseline-${{ matrix.branch }}
base: ${{ matrix.branch }}