woocommerce/plugins/woocommerce-blocks/.github/workflows/js-css-linting.yml

43 lines
973 B
YAML

name: JavaScript and CSS Linting
on:
pull_request:
push:
branches: [trunk]
jobs:
check:
name: All
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node 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 }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Npm install
run: |
npm install
- name: Lint JavaScript
uses: bradennapier/eslint-plus-action@v3.4.2
with:
issueSummaryOnlyOnEvent: true
- name: Lint CSS
run: npm run lint:css