-
Notifications
You must be signed in to change notification settings - Fork 241
53 lines (40 loc) · 1.36 KB
/
npm-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# SPDX-FileCopyrightText: 2020-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: JS Tests
on: pull_request
jobs:
jest:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
npm-version: [9]
name: node${{ matrix.node-version }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
with:
node-version: ${{ matrix.node-version }}
- name: Set up npm ${{ matrix.npm-version }}
run: npm i -g npm@${{ matrix.npm-version }}
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/coverage-final.json
flags: javascript
fail_ci_if_error: ${{ !github.event.pull_request.head.repo.fork }}
summary:
runs-on: ubuntu-latest
needs:
- jest
if: always()
name: npm-test-summary
steps:
- name: Jest status
run: if ${{ needs.jest.result != 'success' && needs.jest.result != 'skipped' }}; then exit 1; fi