-
-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (71 loc) · 2.12 KB
/
node-coverage.yml
File metadata and controls
88 lines (71 loc) · 2.12 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
name: Node.js CI Coverage
on: # yamllint disable-line rule:truthy
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build-and-test:
name: Build, Lint & Test
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24.x
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Lint
run: npm run lint
- name: Run the tests
run: npm run jest:ci -- --coverage
# Subir cobertura como artifact para que otros jobs lo usen
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage # o la carpeta donde jest genera los reportes
codecov:
name: Upload to Codecov
runs-on: ubuntu-24.04
needs: build-and-test
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Download coverage artifact
uses: actions/download-artifact@v8
with:
name: coverage-report
path: coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
sonarqube:
name: Analyze with SonarQube
runs-on: ubuntu-24.04
needs: build-and-test
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Download coverage artifact
uses: actions/download-artifact@v8
with:
name: coverage-report
path: coverage
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}