forked from elementor/elementor
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 1.7 KB
/
js-qunit.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
name: Qunit
on:
pull_request:
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-20.04
name: Qunit - 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
q-unit:
runs-on: ubuntu-20.04
needs: [ 'file-diff' ]
if: ${{ needs.file-diff.outputs.js_diff || github.event.pull_request.title == null }}
name: Qunit - 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
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
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: Install Dependencies
run: npm ci
- name: "Grunt Scripts"
run: npx grunt scripts
- name: "Run Qunit"
run: npx grunt karma:unit