Merge pull request #167 from 10up/bump/wp-version #316
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linting | |
on: | |
push: | |
branches: | |
- develop | |
- trunk | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
eslint: | |
name: eslint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install NPM dependencies | |
run: npm ci | |
- name: Run eslint | |
run: npm run lint-js | |
phpcs: | |
name: phpcs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set PHP version | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
coverage: none | |
tools: composer:v1, cs2pr | |
- name: composer install | |
run: composer install | |
- name: PHPCS check | |
id: phpcs-sniffs | |
run: ./vendor/bin/phpcs . --report-full --warning-severity=0 --report-checkstyle=${RUNNER_TEMP}/phpcs-report.xml | |
- name: Show PHPCS results in PR | |
if: ${{ always() }} | |
run: cs2pr ${RUNNER_TEMP}/phpcs-report.xml |