5
5
6
6
name : Node
7
7
8
- on :
9
- pull_request :
10
- paths :
11
- - ' .github/workflows/**'
12
- - ' src/**'
13
- - ' appinfo/info.xml'
14
- - ' package.json'
15
- - ' package-lock.json'
16
- - ' tsconfig.json'
17
- - ' **.js'
18
- - ' **.ts'
19
- - ' **.vue'
20
- push :
21
- branches :
22
- - main
23
- - master
24
- - stable*
8
+ on : pull_request
25
9
26
10
permissions :
27
11
contents : read
@@ -31,30 +15,59 @@ concurrency:
31
15
cancel-in-progress : true
32
16
33
17
jobs :
18
+ changes :
19
+ runs-on : ubuntu-latest
20
+
21
+ outputs :
22
+ src : ${{ steps.changes.outputs.src}}
23
+
24
+ steps :
25
+ - uses : dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
26
+ id : changes
27
+ continue-on-error : true
28
+ with :
29
+ filters : |
30
+ src:
31
+ - '.github/workflows/**'
32
+ - 'src/**'
33
+ - 'appinfo/info.xml'
34
+ - 'package.json'
35
+ - 'package-lock.json'
36
+ - 'tsconfig.json'
37
+ - '**.js'
38
+ - '**.ts'
39
+ - '**.vue'
40
+
34
41
build :
35
42
runs-on : ubuntu-latest
36
43
37
- name : node
44
+ needs : changes
45
+ if : needs.changes.outputs.src != 'false'
46
+
47
+ name : NPM build
38
48
steps :
39
49
- name : Checkout
40
- uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
50
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
41
51
42
52
- name : Read package.json node and npm engines version
43
- uses : skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
53
+ uses : skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
44
54
id : versions
45
55
with :
46
- fallbackNode : ' ^16 '
47
- fallbackNpm : ' ^7 '
56
+ fallbackNode : ' ^20 '
57
+ fallbackNpm : ' ^9 '
48
58
49
59
- name : Set up node ${{ steps.versions.outputs.nodeVersion }}
50
- uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
60
+ uses : actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3
51
61
with :
52
62
node-version : ${{ steps.versions.outputs.nodeVersion }}
53
63
54
64
- name : Set up npm ${{ steps.versions.outputs.npmVersion }}
55
65
run : npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
56
66
57
67
- name : Install dependencies & build
68
+ env :
69
+ CYPRESS_INSTALL_BINARY : 0
70
+ PUPPETEER_SKIP_DOWNLOAD : true
58
71
run : |
59
72
npm ci
60
73
npm run build --if-present
69
82
git status
70
83
git --no-pager diff
71
84
exit 1 # make it red to grab attention
85
+
86
+ summary :
87
+ permissions :
88
+ contents : none
89
+ runs-on : ubuntu-latest
90
+ needs : [changes, build]
91
+
92
+ if : always()
93
+
94
+ # This is the summary, we just avoid to rename it so that branch protection rules still match
95
+ name : node
96
+
97
+ steps :
98
+ - name : Summary status
99
+ run : if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi
0 commit comments