forked from elementor/elementor
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.4 KB
/
jest.yml
File metadata and controls
54 lines (50 loc) · 1.4 KB
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
name: Jest
on:
pull_request:
paths-ignore:
- '**.md'
- '**.txt'
- '.github/config.json'
- 'bin/**'
- '.gitignore'
- 'docs/**'
merge_group:
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
file-diff:
runs-on: ubuntu-22.04
name: File Diff
if: startsWith( github.repository, 'elementor/' )
outputs:
js_diff: ${{ steps.js_diff_files.outputs.diff }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Check JS files diff
id: js_diff_files
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/*.+(js|ts|json|jsx|tsx)
package*.json
.github/**/*.yml
jest:
runs-on: ubuntu-22.04
needs: [ 'file-diff' ]
if: ${{ needs.file-diff.outputs.js_diff || github.event.pull_request.title == null }}
name: Test
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install Dependencies
run: npm run prepare-environment:ci
- name: "Run Jest"
run: npm run test