woocommerce/.github/workflows/pr-code-sniff.yml

52 lines
1.5 KiB
YAML
Raw Normal View History

name: Run code sniff on PR
on:
pull_request:
paths-ignore:
- '**/changelog/**'
2021-10-13 03:38:36 +00:00
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
test:
name: Code sniff (PHP 7.4, WP Latest)
timeout-minutes: 15
runs-on: ubuntu-20.04
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Changed Files
id: changed-files
2023-09-26 18:40:38 +00:00
uses: tj-actions/changed-files@v39
with:
path: plugins/woocommerce
2023-09-26 18:40:38 +00:00
files: "**/*.php"
- name: Setup WooCommerce Monorepo
if: steps.changed-files.outputs.any_changed == 'true'
uses: ./.github/actions/setup-woocommerce-monorepo
with:
build: false
- name: Tool versions
if: steps.changed-files.outputs.any_changed == 'true'
2023-08-09 00:20:34 +00:00
working-directory: plugins/woocommerce
run: |
php --version
composer --version
phpcs-changed --version
- name: Run PHPCS
if: steps.changed-files.outputs.any_changed == 'true'
2023-08-09 00:20:34 +00:00
working-directory: plugins/woocommerce
2023-09-26 18:40:38 +00:00
run: phpcs-changed -s --git --git-base ${{ github.event.pull_request.base.sha }} ${{ steps.changed-files.outputs.all_changed_files }}