-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.13 KB
/
linting-action.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
name: Lint
on: [pull_request, push]
jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Node.js version ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Enable Corepack
run: corepack enable
- name: Set Yarn version
run: yarn set version 4.2.2
- name: Cache yarn dependencies
uses: actions/cache@v2
env:
cache-name: cache-yarn-dependencies
with:
path: |
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
- name: Run linters
run: yarn lint # assumes you have a `lint` script in package.json for ESLint and Prettier