chore(ci): reuse style workflow from php-tools #2157
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: Lint | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
jobs: | ||
style: | ||
name: PHP Style Check | ||
uses: GoogleCloudPlatform/php-tools/.github/workflows/code-standards.yml@main | ||
with: | ||
add_rules: | | ||
{ | ||
"method_argument_space": { | ||
"keep_multiple_spaces_after_comma": true, | ||
"on_multiline": "ignore" | ||
}, | ||
"ordered_imports": false, | ||
"new_with_parentheses": false | ||
} | ||
staticanalysis: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
- name: Get changed files | ||
id: changedFiles | ||
uses: tj-actions/changed-files@v44 | ||
- uses: jwalton/gh-find-current-pr@v1 | ||
id: findPr | ||
with: | ||
state: open | ||
- name: Run Script | ||
run: | | ||
composer install -d testing/ | ||
git fetch --no-tags --prune --depth=5 origin main | ||
bash testing/run_staticanalysis_check.sh | ||
env: | ||
FILES_CHANGED: ${{ steps.changedFiles.outputs.all_changed_files }} | ||
PULL_REQUEST_NUMBER: ${{ steps.findPr.outputs.pr }} |