-
Notifications
You must be signed in to change notification settings - Fork 228
65 lines (60 loc) · 1.93 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
name: Lint
on: [push, pull_request]
jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: npm ci
- name: Run Lint
run: npm run lint:js
phpcs:
name: PHPCS
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP 7.4
uses: shivammathur/setup-php@9882bed06691b3a085010c1602ce43ef18f15c5b # v2
with:
php-version: '7.4'
- name: Get composer cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer packages
run: |
composer install --no-progress
composer require php-parallel-lint/php-parallel-lint
- name: Run Lint
run: |
vendor/bin/phpcs -p -s -n . --standard=./phpcs.xml --extensions=php
- name: Run PHP Syntax Lint
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .