-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (62 loc) · 1.96 KB
/
linting.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
name: Linting
on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop
jobs:
eslint:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: npm install
run: npm install
- name: Generate linting report
run: npm run lint:js -- --output-file eslint-report.json --format json
continue-on-error: true
- name: Annotate code linting results
uses: ataylorme/[email protected]
if: ${{ github.actor != 'dependabot[bot]' }} # dependabot doesn't have permissions
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint-report.json'
- name: Update summary
run: |
npm_config_yes=true npx github:10up/eslint-json-to-md --path ./eslint-report.json --output ./eslint-report.md
cat eslint-report.md >> $GITHUB_STEP_SUMMARY
if: ${{ failure() }}
phpcs:
name: WPCS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: WPCS check
uses: 10up/wpcs-action@stable
with:
use_local_config: true
extra_args: '--report-json=./phpcs-report.json'
- name: Update summary
run: |
npx github:10up/phpcs-json-to-md --path ./phpcs-report.json --output ./phpcs-report.md
cat phpcs-report.md >> $GITHUB_STEP_SUMMARY
if: ${{ failure() }}
php_compatibility:
name: PHP minimum 7.4
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
coverage: none
- name: Install dependencies
run: composer install
- name: Run PHP Compatibility
run: vendor/bin/phpcs maps-block-apple.php includes/ -p --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4-