Skip to content

Create npm workspace for E2E tests #13296

Create npm workspace for E2E tests

Create npm workspace for E2E tests #13296

name: Code Linting and JS Tests
on:
push:
branches:
- develop
- main
# Only run if CSS/JS/MD-related files changed.
paths:
- '.github/workflows/js-css-lint-test.yml'
- '**.js'
- '**.json'
- '**.scss'
- '.eslint*'
- '.nvmrc'
- '.stylelint*'
- '**/package.json'
- 'package-lock.json'
- '!feature-flags.json'
- '!composer.json'
pull_request:
branches:
- develop
- main
- 'feature/**'
# Only run if CSS/JS/MD-related files changed.
paths:
- '.github/workflows/js-css-lint-test.yml'
- '**.js'
- '**.json'
- '**.scss'
- '.eslint*'
- '.nvmrc'
- '.stylelint*'
- '**/package.json'
- 'package-lock.json'
- '!feature-flags.json'
- '!composer.json'
types:
- opened
- reopened
- synchronize
concurrency:
group: js-css-lint-test-${{ github.ref }}
cancel-in-progress: true
jobs:
js-css-lint-test:
name: JS + CSS
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
# nvm@7 is the minimum version required for npm workspace support.
# This is needed to prevent js lint failures due to module resolution to the workspace packages.
# This can be removed once our node base version comes with nvm@7 or greater.
- name: Install npm Globally
run: npm run install-global-npm
- name: npm install
run: npm ci
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- name: CSS Lint
run: npm run lint:css
- name: JS Lint
run: npm run lint:js
- name: Jest Tests
run: npm run test:js