Updating node.yml workflow from template

Signed-off-by: Nextcloud bot <bot@nextcloud.com>
This commit is contained in:
Nextcloud bot 2021-07-24 07:34:21 +00:00
parent 265a2714fb
commit 8c7ed065d9
1 changed files with 28 additions and 10 deletions

View File

@ -1,3 +1,8 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: Node
on:
@ -11,18 +16,25 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
name: node${{ matrix.node-version }}
name: node
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
id: versions
with:
node-version: ${{ matrix.node-version }}
fallbackNode: '^12'
fallbackNpm: '^6'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Install dependencies & build
run: |
@ -31,4 +43,10 @@ jobs:
- name: Check webpack build changes
run: |
bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )"
bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1"
- name: Show changes on failure
if: failure()
run: |
git status
git --no-pager diff