-
-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (75 loc) · 2.18 KB
/
Copy pathnode-coverage.js.yml
File metadata and controls
93 lines (75 loc) · 2.18 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
89
90
91
92
93
---
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 26.x
- name: Tool test
run: |
echo "Node.js version:"
node --version
echo "GNU make version:"
make --version
- name: Install dependencies
run: make dependencies
- name: Run the tests with coverage
run: make 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
codecov:
name: Upload to Codecov
runs-on: ubuntu-24.04
needs: build-and-test
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
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@v7
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
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 }}