summaryrefslogtreecommitdiffstats
path: root/.github/workflows/node.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/node.yml')
-rw-r--r--.github/workflows/node.yml93
1 files changed, 33 insertions, 60 deletions
diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml
index dbb654070be..4b20eb5ed02 100644
--- a/.github/workflows/node.yml
+++ b/.github/workflows/node.yml
@@ -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:
@@ -9,71 +14,39 @@ on:
jobs:
build:
-
runs-on: ubuntu-latest
- strategy:
- matrix:
- node-version: [12.x]
-
+ name: node
steps:
- - uses: actions/checkout@v2
- - name: Use node ${{ matrix.node-version }}
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - name: Install dependencies & build
- run: |
- make clean
- npm ci
- npm run build --if-present
- - name: Check webpack build changes
- run: |
- bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )"
- env:
- CI: true
+ - name: Checkout
+ uses: actions/checkout@v2
- test:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- node-version: [12.x]
- steps:
- - uses: actions/checkout@v2
- - name: Use node ${{ matrix.node-version }}
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - name: Install dependencies
- run: |
- npm ci
- - name: Test
- run: npm run test
-
- jsunit:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Use node ${{ matrix.node-version }}
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - name: Test
- run: ./autotest-js.sh
+ - name: Read package.json node and npm engines version
+ uses: skjnldsv/read-package-engines-version-actions@v1.1
+ id: versions
+ with:
+ fallbackNode: '^12'
+ fallbackNpm: '^6'
- handlebars:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- node-version: [12.x]
- steps:
- - uses: actions/checkout@v2
- - name: Use node ${{ matrix.node-version }}
- uses: actions/setup-node@v1
+ - name: Set up node ${{ steps.versions.outputs.nodeVersion }}
+ uses: actions/setup-node@v2
with:
- node-version: ${{ matrix.node-version }}
- - name: Install dependencies
+ 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: |
npm ci
- - name: Run compile
- run: ./build/compile-handlebars-templates.sh
+ npm run build --if-present
+
+ - name: Check webpack build changes
+ run: |
+ bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1"
+
+ - name: Show changes on failure
+ if: failure()
+ run: |
+ git status
+ git --no-pager diff