Merge pull request #142 from 10up/dependabot/npm_and_yarn/npm_and_yar… #283
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@v2 | |
- name: install node v12 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
- name: npm install | |
run: npm install | |
- name: eslint | |
uses: icrawl/action-eslint@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
custom-glob: assets | |
phpcs: | |
name: phpcs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- 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 |