generated from 10up/plugin-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 1.48 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Lint
on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop
jobs:
changed-files:
name: Changed Files
outputs:
status: ${{ steps.changed-files.outputs.any_changed }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- id: changed-files
uses: tj-actions/changed-files@v26.1
with:
files: |
package.json
package-lock.json
.eslintignore
.eslintrc.json
phpcs.xml
**/*.css
**/*.js
**/*.php
lint:
runs-on: ubuntu-latest
needs: changed-files
if: ${{ needs.changed-files.outputs.status == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Node cache
uses: actions/cache@v3
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
- name: Composer cache
uses: actions/cache@v3
with:
path: |
vendor
~/.composer
key: ${{ runner.os }}-build-${{ hashFiles('composer.lock') }}
- name: Install node
run: npm install
- name: Install composer
run: composer install
- name: Lint style
run: npm run lint-style
- name: Lint JS
run: npm run lint-js
- name: Lint PHP
run: npm run lint-php