-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (35 loc) · 883 Bytes
/
Copy pathlint-code.yml
File metadata and controls
43 lines (35 loc) · 883 Bytes
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
# Name of workflow
name: Linting code
# When workflow is triggered
on: push
# Jobs to carry out
jobs:
install:
# Operating system to run on
runs-on: ubuntu-latest
# Command to run
steps:
# Get code from repo
- name: Checkout code
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
lint:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Linting code
run: npm run lint