Skip to content

Commit

Permalink
Add workflow for ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Oct 3, 2024
1 parent caf5374 commit 816618a
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ESLint

on:
pull_request:
types: [opened, synchronize]

concurrency:
group: eslint-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@4

- name: Remove version from package-lock.json
run: jq 'del(.version, .packages[""].version)' package-lock.json > normalized-package-lock.json

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: normalized-package-lock.json

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}

- name: Run npm install
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847
with:
timeout_minutes: 30
max_attempts: 3
command: npm ci

- name: Run ESLint
run: npm run lint

0 comments on commit 816618a

Please sign in to comment.