mirror of
https://ghproxy.net/https://github.com/fairpm/fair-plugin.git
synced 2025-09-04 12:45:45 +08:00
62 lines
1.9 KiB
YAML
62 lines
1.9 KiB
YAML
name: PHP coding standards
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
# Cancels all previous workflow runs for pull requests that have not completed.
|
|
concurrency:
|
|
# The concurrency group contains the workflow name and the branch name for pull requests
|
|
# or the commit hash for any other events.
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
# Disable permissions for all available scopes by default.
|
|
# Any needed permissions should be configured at the job level.
|
|
permissions: {}
|
|
|
|
jobs:
|
|
# Runs the PHP coding standards checks.
|
|
#
|
|
# Violations are reported inline with annotations.
|
|
#
|
|
# Performs the following steps:
|
|
# - Checks out the repository.
|
|
# - Sets up PHP.
|
|
# - Installs Composer dependencies.
|
|
# - Make Composer packages available globally.
|
|
# - Runs PHPCS on the full codebase (warnings excluded).
|
|
# - Ensures version-controlled files are not modified or deleted.
|
|
phpcs:
|
|
name: Run coding standards checks
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
|
|
|
|
- name: Set up PHP
|
|
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0
|
|
with:
|
|
coverage: none
|
|
|
|
- name: Install Composer dependencies
|
|
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1
|
|
|
|
- name: Make Composer packages available globally
|
|
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
|
|
|
|
- name: Run PHPCS on all files
|
|
id: phpcs-files
|
|
run: phpcs . -n --report-full
|
|
|
|
- name: Ensure version-controlled files are not modified during the checks
|
|
run: git diff --exit-code
|