Skip to content

Commit

Permalink
add action to refresh phpstan baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Nov 12, 2024
1 parent 718a70e commit 68250f2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/phpstan_baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ on:
# We want to be able to manually refresh the baseline too
workflow_dispatch:

workflow_call:
inputs:
gh_event:
required: true
type: string
# Run PHPStan analyse on pull requests
pull_request:

env:
PHP_VERSION: '8.2'
gh_event: ${{ inputs.gh_event || github.event_name }}
CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
jobs:
phpstan:
runs-on: ubuntu-22.04
Expand All @@ -29,11 +36,25 @@ jobs:
mysql, pgsql, sqlite3, ldap, xml, mcrypt
env:
fail-fast: true
# Restore old cache
- name: Restore phpstan cache
id: cache
uses: actions/cache/restore@v4
with:
path: ./.github/tmp
key: phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-${{
github.run_id }}
restore-keys: |
phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.head_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.base_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-
- uses: ruudk/phpstan-baseline-refresh-create-pr-action@main
with:
github_token: ${{ secrets.PAT_GITHUB_TOKEN }}
phpstan_path: phpstan
configuration_path: phpstan.neon.dist
phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php
baseline_path: build/phpstan/phpstan-baseline.neon
commit_name: Dolibot
commit_email: dolibarr-bot@users.noreply.github.com
Expand Down

0 comments on commit 68250f2

Please sign in to comment.