-
Notifications
You must be signed in to change notification settings - Fork 74
43 lines (36 loc) · 1.06 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
name: Lint
on:
workflow_call:
jobs:
lint-pull-request:
name: Lint
runs-on: ubuntu-22.04
steps:
- name: Setup node v22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Construct cache keys
run: |
echo node_modules_key='["${{ runner.os }}", "node_modules", "22.x", "${{ hashFiles('package.json', 'yarn.lock') }}"]' >> $GITHUB_ENV;
- name: Cache node_modules
uses: actions/cache@v4
with:
key: ${{ join(fromJSON(env.node_modules_key), '-') }}
path: node_modules
- name: Check if source or test files changed
id: files_changed
uses: tj-actions/changed-files@v44
with:
files: |
src/**/*
spec/**/*
- name: Lint files
if: ${{ steps.files_changed.outputs.any_modified == 'true' }}
run: |
yarn --ignore-engines --non-interactive
yarn lint:ci