Skip to content

Commit 528693d

Browse files
authored
Merge pull request #753 from sir-gon/develop
[REFACTOR] [Github Actions] codecov and sonarcloud now runs in parallel
2 parents 4365671 + 0e062af commit 528693d

File tree

2 files changed

+45
-10
lines changed

2 files changed

+45
-10
lines changed

.github/workflows/node-coverage.yml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ on: # yamllint disable-line rule:truthy
55
push:
66
branches: ["main"]
77
pull_request:
8-
# The branches below must be a subset of the branches above
98
branches: ["main"]
109
workflow_dispatch:
1110

1211
jobs:
13-
coverage:
14-
name: NodeJS CI Coverage
12+
build-and-test:
13+
name: Build, Lint & Test
1514
runs-on: ubuntu-24.04
1615

1716
steps:
@@ -23,7 +22,7 @@ jobs:
2322
- name: Set up Node.js
2423
uses: actions/setup-node@v4
2524
with:
26-
node-version: 24.x
25+
node-version: 22.x
2726

2827
- name: Install dependencies
2928
run: npm ci --verbose
@@ -34,15 +33,51 @@ jobs:
3433
- name: Run the tests
3534
run: npm run jest:ci -- --coverage
3635

37-
- name: Upload coverage reports to Codecov with GitHub Action
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
3857
uses: codecov/codecov-action@v5
3958
with:
40-
token: ${{ secrets.CODECOV_TOKEN }} # required
41-
verbose: true # optional (default = false)
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
4278

43-
- name: Analyze with SonarQube / SonarCloud
79+
- name: SonarQube Scan
4480
uses: SonarSource/sonarqube-scan-action@master
4581
env:
4682
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
47-
# Needed to get PR information, if any
4883
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/node-test.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: ["ubuntu-24.04", "macos-14", "windows-2022"]
20-
node-version: [20.x, 22.x, 24.x]
20+
node-version: [18.x, 20.x, 22.x]
2121
# See supported Node.js release schedule
2222
# at https://nodejs.org/en/about/releases/
2323

0 commit comments

Comments
 (0)