Skip to content

Commit

Permalink
fix - phpcs workflow was not working
Browse files Browse the repository at this point in the history
  • Loading branch information
mi5t4n committed Dec 4, 2023
1 parent bc4b7fd commit 62e3b1c
Showing 1 changed file with 45 additions and 9 deletions.
54 changes: 45 additions & 9 deletions .github/workflows/phpcs_on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,51 @@
on: pull_request
name: Inspections
on:
pull_request:
types:
- opened
- synchronize
- ready_for_review

# Cancel previous workflow run groups that have not completed.
concurrency:
# Group workflow runs by workflow name, along with the head branch ref of the pull request
# or otherwise the branch or tag ref.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
runPHPCSInspection:
name: Run PHPCS inspection
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run PHPCS inspection
uses: rtCamp/action-phpcs-code-review@master
env:
SKIP_FOLDERS: "tests,.github"
GH_BOT_TOKEN: ${{ secrets.RTBOT_TOKEN }}
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
coverage: none

- name: Configure Composer cache
uses: actions/[email protected]
id: php-composer-cache
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Composer dependencies
if: ${{ steps.php-composer-cache.outputs.cache-hit != 'true' }}
run: composer install --prefer-dist --optimize-autoloader --no-progress --no-interaction

- name: Validate composer.json
run: composer --no-interaction validate --no-check-all
- name: Run PHPCS inspection
uses: rtCamp/action-phpcs-code-review@master
env:
SKIP_FOLDERS: "tests,.github"
GH_BOT_TOKEN: ${{ secrets.RTBOT_TOKEN }}

0 comments on commit 62e3b1c

Please sign in to comment.