Skip to content

Commit 8511c47

Browse files
authored
Update node.yml
1 parent 09dc37a commit 8511c47

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

.github/workflows/node.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
16
name: Node
27

38
on:
@@ -11,18 +16,25 @@ jobs:
1116
build:
1217
runs-on: ubuntu-latest
1318

14-
strategy:
15-
matrix:
16-
node-version: [12.x]
17-
18-
name: node${{ matrix.node-version }}
19+
name: node
1920
steps:
20-
- uses: actions/checkout@v2
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Read package.json node and npm engines version
25+
uses: skjnldsv/read-package-engines-version-actions@v1.1
26+
id: versions
27+
with:
28+
fallbackNode: '^12'
29+
fallbackNpm: '^6'
2130

22-
- name: Set up node ${{ matrix.node-version }}
23-
uses: actions/setup-node@v1
31+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
32+
uses: actions/setup-node@v2
2433
with:
25-
node-version: ${{ matrix.node-version }}
34+
node-version: ${{ steps.versions.outputs.nodeVersion }}
35+
36+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
37+
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
2638

2739
- name: Install dependencies & build
2840
run: |
@@ -31,4 +43,10 @@ jobs:
3143
3244
- name: Check webpack build changes
3345
run: |
34-
bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )"
46+
bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1"
47+
48+
- name: Show changes on failure
49+
if: failure()
50+
run: |
51+
git status
52+
git --no-pager diff

0 commit comments

Comments
 (0)