name: Run linters

on:
  push:
    branches:
      - 'master'
      - 'v*.*'
  pull_request:

jobs:
  lint:
    runs-on: ubuntu-18.04

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Use Node.js 10.x
        uses: actions/setup-node@v1
        with:
          node-version: "10.x"

      - name: Install npm dependencies
        run: npm ci

      - name: Eslint
        run: npm run lint:js

      - name: Stylelint
        run: npm run lint:sass

      - name: Check build
        run: npm run build
