69 lines
2.0 KiB
YAML
69 lines
2.0 KiB
YAML
name: JavaScript and CSS Linting
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [trunk]
|
|
|
|
jobs:
|
|
# cache node and modules
|
|
Setup:
|
|
name: Setup
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup node version and npm cache
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
- name: Install Node dependencies
|
|
run: npm ci --no-optional
|
|
|
|
JSLintingCheck:
|
|
name: Lint JavaScript
|
|
needs: Setup
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup node version and npm cache
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
- name: Install Node dependencies
|
|
run: npm ci --no-optional
|
|
- name: Save code linting report JSON
|
|
run: npm run lint:js:report
|
|
# Continue to the next step even if this fails
|
|
continue-on-error: true
|
|
- name: Upload ESLint report
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: eslint_report.json
|
|
path: eslint_report.json
|
|
- name: Annotate code linting results
|
|
uses: ataylorme/eslint-annotate-action@1.2.0
|
|
with:
|
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
report-json: 'eslint_report.json'
|
|
|
|
CSSLintingCheck:
|
|
name: Lint CSS
|
|
needs: Setup
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup node version and npm cache
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
- name: Install Node dependencies
|
|
run: npm ci --no-optional
|
|
- name: Lint CSS
|
|
run: npm run lint:css
|