Merge pull request #563 from nextcloud-libraries/dependabot/npm_and_y… #285
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- master | |
- stable* | |
permissions: | |
contents: read | |
concurrency: | |
group: node-tests-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Read package.json node and npm engines version | |
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 | |
id: versions | |
with: | |
fallbackNode: '^20' | |
fallbackNpm: '^9' | |
- name: Set up node ${{ steps.versions.outputs.nodeVersion }} | |
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 | |
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: | | |
npm ci | |
npm run build --if-present | |
- name: Build package | |
run: npm run build | |
- name: Tests | |
run: npm run test | |
summary: | |
runs-on: ubuntu-latest | |
needs: test | |
if: always() | |
name: test-summary | |
steps: | |
- name: Summary status | |
run: if ${{ needs.test.result != 'success' && needs.test.result != 'skipped' }}; then exit 1; fi |