2021-02-09 10:39:56 +00:00
|
|
|
name: Run code sniff on PR
|
|
|
|
on:
|
|
|
|
pull_request
|
2021-10-13 03:38:36 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2022-04-21 16:45:12 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2021-02-09 10:39:56 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Code sniff (PHP 7.4, WP Latest)
|
|
|
|
timeout-minutes: 15
|
2022-04-27 01:28:56 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-09 10:39:56 +00:00
|
|
|
steps:
|
2022-05-17 18:48:24 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-03-14 00:01:21 +00:00
|
|
|
with:
|
2022-06-27 18:46:29 +00:00
|
|
|
fetch-depth: 0
|
2021-02-09 10:39:56 +00:00
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: 7.4
|
2022-06-27 18:46:29 +00:00
|
|
|
tools: composer
|
2021-02-09 10:39:56 +00:00
|
|
|
|
|
|
|
- name: Tool versions
|
|
|
|
run: |
|
|
|
|
php --version
|
|
|
|
composer --version
|
|
|
|
|
2022-05-17 18:48:24 +00:00
|
|
|
- uses: ./.github/actions/cache-deps
|
2021-02-09 10:39:56 +00:00
|
|
|
with:
|
2022-05-17 18:48:24 +00:00
|
|
|
workflow_name: pr-code-sniff
|
|
|
|
workflow_cache: ${{ secrets.WORKFLOW_CACHE }}
|
2021-02-09 10:39:56 +00:00
|
|
|
|
2022-05-17 18:48:24 +00:00
|
|
|
- name: Install and Build
|
|
|
|
uses: ./.github/actions/install-build
|
2022-07-22 11:32:03 +00:00
|
|
|
with:
|
|
|
|
composer_no_dev: 0
|
2021-02-09 10:39:56 +00:00
|
|
|
|
2022-06-27 18:46:29 +00:00
|
|
|
- name: Run code sniffer
|
|
|
|
uses: thenabeel/action-phpcs@v8
|
|
|
|
with:
|
|
|
|
files: "**.php"
|
|
|
|
phpcs_path: plugins/woocommerce/vendor/bin/phpcs
|
|
|
|
standard: phpcs.xml
|