forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.97 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
name: Static Analysis (Linting, License, Type checks...)
on:
pull_request:
push:
branches:
- trunk
- 'release/**'
- 'wp/**'
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
check:
name: All
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: Use desired version of Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
check-latest: true
cache: npm
- name: Npm install
# A "full" install is executed, since `npm ci` does not always exit
# with an error status code if the lock file is inaccurate. This also
# helps to catch dependencies not being installed with exact version.
#
# See: https://github.com/WordPress/gutenberg/issues/16157
# See: https://github.com/WordPress/gutenberg/pull/39865
run: npm install
- name: Lint JavaScript and Styles
run: npm run lint
- name: Type checking
run: npm run build:package-types
- name: Check local changes
run: npm run other:check-local-changes
- name: License compatibility
run: npm run other:check-licenses