forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.46 KB
/
reusable-coding-standards-javascript.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
##
# A reusable workflow that checks the JavaScript coding standards.
##
name: JavaScript coding standards
on:
workflow_call:
env:
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
jobs:
# Runs the JavaScript coding standards checks.
#
# JSHint violations are not currently reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up Node.js.
# - Logs debug information about the GitHub Action runner.
# - Installs npm dependencies.
# - Run the WordPress JSHint checks.
# - Ensures version-controlled files are not modified or deleted.
jshint:
name: Run coding standards checks
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: Log debug information
run: |
npm --version
node --version
git --version
- name: Install npm Dependencies
run: npm ci
- name: Run JSHint
run: npm run grunt jshint
- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code