mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
This ensures a seamless transition when the primary branch is changed from `master` to `trunk` in the GitHub mirror. Once the transition is completed, the `master` branch can be removed. See https://make.wordpress.org/systems/2021/03/02/update-git-wordpress-org-to-rename-master-to-trunk/ and https://make.wordpress.org/core/2020/06/18/proposal-update-all-git-repositories-to-use-main-instead-of-master/. See #52625. git-svn-id: https://develop.svn.wordpress.org/trunk@50473 602fd350-edb4-49c9-b593-d223f7449a82
130 lines
3.6 KiB
YAML
130 lines
3.6 KiB
YAML
name: Coding Standards
|
|
|
|
on:
|
|
# JSHint was introduced in WordPress 3.8.
|
|
# PHPCS checking was introduced in WordPress 5.1.
|
|
push:
|
|
branches:
|
|
- master
|
|
- trunk
|
|
- '3.[89]'
|
|
- '[4-9].[0-9]'
|
|
tags:
|
|
- '3.[89]*'
|
|
- '[4-9].[0-9]*'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- trunk
|
|
- '3.[89]'
|
|
- '[4-9].[0-9]'
|
|
|
|
jobs:
|
|
# Runs PHP coding standards checks.
|
|
#
|
|
# Violations are reported inline with annotations.
|
|
#
|
|
# Performs the following steps:
|
|
# - Checks out the repository.
|
|
# - Sets up PHP.
|
|
# - Logs debug information.
|
|
# - Installs Composer dependencies (use cache if possible).
|
|
# - Make Composer packages available globally.
|
|
# - Logs PHP_CodeSniffer debug information.
|
|
# - Runs PHPCS on the full codebase with warnings suppressed.
|
|
# - Runs PHPCS on the `tests` directory without warnings suppressed.
|
|
# - todo: Configure Slack notifications for failing scans.
|
|
phpcs:
|
|
name: PHP coding standards
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '7.4'
|
|
coverage: none
|
|
tools: composer, cs2pr
|
|
|
|
- name: Log debug information
|
|
run: |
|
|
php --version
|
|
composer --version
|
|
|
|
- name: Install Composer dependencies
|
|
uses: ramsey/composer-install@v1
|
|
with:
|
|
composer-options: "--no-progress --no-ansi --no-interaction"
|
|
|
|
- name: Make Composer packages available globally
|
|
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
|
|
|
|
- name: Log PHPCS debug information
|
|
run: phpcs -i
|
|
|
|
- name: Run PHPCS on all Core files
|
|
run: phpcs -q -n --report=checkstyle | cs2pr
|
|
|
|
- name: Check test suite files for warnings
|
|
run: phpcs tests -q --report=checkstyle | cs2pr
|
|
|
|
# Runs the JavaScript coding standards checks.
|
|
#
|
|
# JSHint violations are not currently reported inline with annotations.
|
|
#
|
|
# Performs the following steps:
|
|
# - Checks out the repository.
|
|
# - Logs debug information about the runner container.
|
|
# - Installs NodeJS 14.
|
|
# - Sets up caching for NPM.
|
|
# - Logs updated debug information.
|
|
# _ Installs NPM dependencies using install-changed to hash the `package.json` file.
|
|
# - Run the WordPress JSHint checks.
|
|
# - todo: Configure Slack notifications for failing tests.
|
|
jshint:
|
|
name: JavaScript coding standards
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
|
|
env:
|
|
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Log debug information
|
|
run: |
|
|
npm --version
|
|
node --version
|
|
git --version
|
|
svn --version
|
|
|
|
- name: Install NodeJS
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 14
|
|
|
|
- name: Cache NodeJS modules
|
|
uses: actions/cache@v2
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
- name: Log debug information
|
|
run: |
|
|
npm --version
|
|
node --version
|
|
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
|
|
- name: Run JSHint
|
|
run: npm run grunt jshint
|