-
Notifications
You must be signed in to change notification settings - Fork 32
49 lines (42 loc) · 1.51 KB
/
linters.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
# GitHub workflow file
name: Javascript linter
on:
push:
# change(s) on those files trigger this pipeline
paths: ['*.js']
jobs:
linters: # run linters in separate job to not delay critical stuff
timeout-minutes: 10
runs-on: ubuntu-20.04
steps:
- name: Copy the repository
uses: actions/checkout@v2
# Node 12 included in LTS ubuntu-20.04 matches the version used for AWS Lambda
# (https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu2004-README.md)
# hence comment the upgrade code for now
# - name: Check Node 12
# uses: actions/[email protected]
# with:
# node-version: 12
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# Install nodejs packages listed in package-lock.json.
# - if: github.base_ref == 'master'
- name: Install node modules
run: npm ci --no-fund
- name: Run linters
uses: samuelmeuli/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
# Enable linters
eslint: true
prettier: false