Skip to content

Commit 5de059a

Browse files
committed
chore: update workflows from templates
Signed-off-by: skjnldsv <[email protected]>
1 parent c923d6f commit 5de059a

File tree

1 file changed

+57
-26
lines changed

1 file changed

+57
-26
lines changed

.github/workflows/node.yml

+57-26
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,13 @@
22
#
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
58

69
name: Node
710

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*
11+
on: pull_request
2512

2613
permissions:
2714
contents: read
@@ -31,30 +18,62 @@ concurrency:
3118
cancel-in-progress: true
3219

3320
jobs:
21+
changes:
22+
runs-on: ubuntu-latest-low
23+
permissions:
24+
contents: read
25+
pull-requests: read
26+
27+
outputs:
28+
src: ${{ steps.changes.outputs.src}}
29+
30+
steps:
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
32+
id: changes
33+
continue-on-error: true
34+
with:
35+
filters: |
36+
src:
37+
- '.github/workflows/**'
38+
- 'src/**'
39+
- 'appinfo/info.xml'
40+
- 'package.json'
41+
- 'package-lock.json'
42+
- 'tsconfig.json'
43+
- '**.js'
44+
- '**.ts'
45+
- '**.vue'
46+
3447
build:
3548
runs-on: ubuntu-latest
3649

37-
name: node
50+
needs: changes
51+
if: needs.changes.outputs.src != 'false'
52+
53+
name: NPM build
3854
steps:
3955
- name: Checkout
40-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
56+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4157

4258
- name: Read package.json node and npm engines version
43-
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
59+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4460
id: versions
4561
with:
46-
fallbackNode: '^16'
47-
fallbackNpm: '^7'
62+
fallbackNode: '^20'
63+
fallbackNpm: '^10'
4864

4965
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
50-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
66+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
5167
with:
5268
node-version: ${{ steps.versions.outputs.nodeVersion }}
5369

5470
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
55-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
71+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
5672

5773
- name: Install dependencies & build
74+
env:
75+
CYPRESS_INSTALL_BINARY: 0
76+
PUPPETEER_SKIP_DOWNLOAD: true
5877
run: |
5978
npm ci
6079
npm run build --if-present
@@ -70,5 +89,17 @@ jobs:
7089
git --no-pager diff
7190
exit 1 # make it red to grab attention
7291
73-
- name: Test
74-
run: npm run test --if-present
92+
summary:
93+
permissions:
94+
contents: none
95+
runs-on: ubuntu-latest-low
96+
needs: [changes, build]
97+
98+
if: always()
99+
100+
# This is the summary, we just avoid to rename it so that branch protection rules still match
101+
name: node
102+
103+
steps:
104+
- name: Summary status
105+
run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)