forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (45 loc) · 1.43 KB
/
static-checks.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
name: Static Analysis (Linting, License, Type checks...)
on:
pull_request:
push:
branches: [master]
jobs:
check:
name: All
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
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: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Npm install and build
# A "full" install is executed, since `npm ci` does not always exit
# with an error status code if the lock file is inaccurate.
#
# See: https://github.com/WordPress/gutenberg/issues/16157
run: |
npm install
npm run build
- name: Lint JavaScript and Styles
run: npm run lint
- name: Lint ES5 built files (IE11)
run: npx eslint --parser-options=ecmaVersion:5 --no-eslintrc --no-ignore ./build/**/*.js
- name: Type checking
run: npm run build:package-types
- name: Build artifacts
run: npm run check-local-changes
- name: License compatibility
run: npm run check-licenses