-
Notifications
You must be signed in to change notification settings - Fork 35
57 lines (49 loc) · 1.33 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: ESLint Check
on:
workflow_call:
inputs:
config_path:
required: true
type: string
ignore_path:
required: true
type: string
file_path:
required: true
type: string
jobs:
eslint:
name: ESLint Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
- name: Use Actions Dev Cache
uses: actions/cache@v2
id: yarn-dev-cache
with:
path: "**/node_modules"
key: ${{ runner.os }}-dev-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dev Dependencies
if: steps.yarn-dev-cache.outputs.cache-hit != 'true'
run: |
cd client
yarn install
- name: Install ESLint
run: yarn global add eslint
- name: Run ESLint
run: |
cd client
yarn next lint -c ${{ inputs.config_path }} --ignore-path ${{ inputs.ignore_path }} --output-file eslint_report.txt ${{ inputs.file_path }}
- name: ESLint Output
if: ${{ failure() }}
shell: bash
run: |
cd client
cat eslint_report.txt