@@ -5,12 +5,13 @@ on: # yamllint disable-line rule:truthy
5
5
push :
6
6
branches : ["main"]
7
7
pull_request :
8
+ # The branches below must be a subset of the branches above
8
9
branches : ["main"]
9
10
workflow_dispatch :
10
11
11
12
jobs :
12
- build-and-test :
13
- name : Build, Lint & Test
13
+ coverage :
14
+ name : NodeJS CI Coverage
14
15
runs-on : ubuntu-24.04
15
16
16
17
steps :
22
23
- name : Set up Node.js
23
24
uses : actions/setup-node@v4
24
25
with :
25
- node-version : 24 .x
26
+ node-version : 22 .x
26
27
27
28
- name : Install dependencies
28
29
run : npm ci --verbose
@@ -33,51 +34,15 @@ jobs:
33
34
- name : Run the tests
34
35
run : npm run jest:ci -- --coverage
35
36
36
- # Subir cobertura como artifact para que otros jobs lo usen
37
- - name : Upload coverage artifact
38
- uses : actions/upload-artifact@v4
39
- with :
40
- name : coverage-report
41
- path : coverage # o la carpeta donde jest genera los reportes
42
-
43
-
44
- codecov :
45
- name : Upload to Codecov
46
- runs-on : ubuntu-24.04
47
- needs : build-and-test
48
-
49
- steps :
50
- - name : Download coverage artifact
51
- uses : actions/download-artifact@v5
52
- with :
53
- name : coverage-report
54
- path : coverage
55
-
56
- - name : Upload coverage reports to Codecov
37
+ - name : Upload coverage reports to Codecov with GitHub Action
57
38
uses : codecov/codecov-action@v5
58
39
with :
59
- token : ${{ secrets.CODECOV_TOKEN }}
60
- verbose : true
61
-
62
- sonarqube :
63
- name : Analyze with SonarQube
64
- runs-on : ubuntu-24.04
65
- needs : build-and-test
66
-
67
- steps :
68
- - name : Checkout repository
69
- uses : actions/checkout@v5
70
- with :
71
- fetch-depth : 0
72
-
73
- - name : Download coverage artifact
74
- uses : actions/download-artifact@v5
75
- with :
76
- name : coverage-report
77
- path : coverage
40
+ token : ${{ secrets.CODECOV_TOKEN }} # required
41
+ verbose : true # optional (default = false)
78
42
79
- - name : SonarQube Scan
43
+ - name : Analyze with SonarQube / SonarCloud
80
44
uses : SonarSource/sonarqube-scan-action@master
81
45
env :
82
46
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
47
+ # Needed to get PR information, if any
83
48
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments