-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 898 Bytes
/
eslint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: ESLint
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: npm ci # instead of install to ensure consistency and determinism in CI/CD workflow
- name: Run ESLint
run: npm run lint
- name: Cache node modules and eslintrc.js
uses: actions/cache@v2
with:
path: |
node_modules
.eslintrc.js
# Modify cache keys for restoration
key: ${{ runner.os }}-eslintrc-${{ hashFiles('.eslintrc.js') }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-eslintrc- ${{ runner.os }}-node-modules-