diff options
Diffstat (limited to '.github/workflows/coding-standards.yml')
-rw-r--r-- | .github/workflows/coding-standards.yml | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 218142ffed..a3a69d34ea 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -1,17 +1,38 @@ name: Coding Standards on: + # JSHint was introduced in WordPress 3.8. + # PHPCS checking was introduced in WordPress 5.1. push: branches: - master - # JSHint was introduced in WordPress 3.8. - # PHPCS checking was introduced in WordPress 5.1. + - 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]' + paths: + # Any change to a PHP or JavaScript file should run checks. + - '**.js' + - '**.php' + # These files configure NPM. Changes could affect the outcome. + - 'package*.json' + # These files configure Composer. Changes could affect the outcome. + - 'composer.*' + # This file configures JSHint. Changes could affect the outcome. + - '.jshintrc' + # This file configures PHPCS. Changes could affect the outcome. + - 'phpcs.xml.dist' + # Changes to workflow files should always verify all workflows are successful. + - '.github/workflows/*.yml' + workflow_dispatch: jobs: # Runs the JavaScript coding standards checks. @@ -36,7 +57,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Log debug information run: | @@ -46,20 +67,18 @@ jobs: svn --version - name: Install NodeJS - uses: actions/setup-node@v1 + uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5 with: node-version: 14 - name: Cache NodeJS modules - uses: actions/cache@v2 + uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 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') }} - restore-keys: | - ${{ runner.os }}-npm- - name: Log debug information run: | @@ -67,7 +86,7 @@ jobs: node --version - name: Install Dependencies - run: npx install-changed --install-command="npm ci" + run: npm ci - name: Run JSHint run: npm run grunt jshint |