-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.17 KB
/
lint.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
39
40
41
42
43
44
45
46
47
48
49
50
name: Lint
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches: [main]
workflow_dispatch:
jobs:
linting:
name: Linting Code
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache NPM
id: cache-npm
uses: actions/cache@v3
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Install Dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci
- name: Cache Lint
id: cache-lint
uses: actions/cache@v3
with:
path: |
./node_modules/.cache/prettier
./node_modules/.cache/.eslintcache
key: ${{ runner.os }}-lint-${{ github.sha }}
restore-keys: ${{ runner.os }}-lint-
- name: Code Linting
if: steps.cache-lint.outputs.cache-hit != 'true'
run: npm run lint