Skip to content

Next 0000/add acceptance workflow #3

Next 0000/add acceptance workflow

Next 0000/add acceptance workflow #3

name: Lint Storefront
on:
push:
branches:
- trunk
paths:
- src/Storefront/Resources/app/storefront/**/*
pull_request:
paths:
- src/Storefront/Resources/app/storefront/**/*
jobs:
check:
runs-on: ubuntu-latest
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
steps:
- name: Clone platform
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Retrieve the cached "node_modules" directory (if present)
uses: actions/cache@v3
id: node-cache
with:
path: src/Storefront/Resources/app/storefront/node_modules
key: storefront-node-modules-${{ runner.os }}-${{ hashFiles('src/Storefront/Resources/app/storefront/package-lock.json') }}
- name: Install dependencies (if the cached directory was not found)
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm --prefix src/Storefront/Resources/app/storefront ci --no-audit --prefer-offline
- name: Cache ESLint
uses: actions/cache@v3
with:
path: src/Storefront/Resources/app/storefront/node_modules/.eslintcache
key: storefront-eslint-${{ runner.os }}
- name: Cache Stylelint
uses: actions/cache@v3
with:
path: src/Storefront/Resources/app/storefront/node_modules/.stylelintcache
key: storefront-stylelint-${{ runner.os }}
- name: Check Code
run: |
cd src/Storefront/Resources/app/storefront
npm run lint:js
npm run lint:scss