-
Notifications
You must be signed in to change notification settings - Fork 17
62 lines (57 loc) · 2.31 KB
/
Copy pathnode.js.yml
File metadata and controls
62 lines (57 loc) · 2.31 KB
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
54
55
56
57
58
59
60
61
62
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 24.X]
steps:
- name: Harden Runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run ci-prettify
if: ${{ matrix.node-version == '24.x' }}
- run: npm run compile --if-present
- run: npm run test:ci
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v1
if: success() || failure() # run this step even if previous step failed
continue-on-error: true
with:
name: Vitest Tests # Name of the check run which will be created
path: junit.xml # Path to test results
reporter: java-junit # Vitest's JUnit reporter emits standard JUnit XML
fail-on-error: 'false'
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
name: Upload Coverage Results
if: ${{ matrix.node-version == '24.x' }}
- run: mv junit.xml rps-unit-${{ matrix.node-version }}.xml
- name: Upload Vitest Results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: rps-unit-${{ matrix.node-version }}
path: rps-unit-${{ matrix.node-version }}.xml
- name: Upload Coverage Artifacts
if: ${{ matrix.node-version == '24.x' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: rps-coverage
path: coverage/