Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 44 additions & 9 deletions .github/workflows/node-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ on: # yamllint disable-line rule:truthy
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
workflow_dispatch:

jobs:
coverage:
name: NodeJS CI Coverage
build-and-test:
name: Build, Lint & Test
runs-on: ubuntu-24.04

steps:
Expand All @@ -23,7 +22,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24.x
node-version: 22.x

- name: Install dependencies
run: npm ci --verbose
Expand All @@ -34,15 +33,51 @@ jobs:
- name: Run the tests
run: npm run jest:ci -- --coverage

- name: Upload coverage reports to Codecov with GitHub Action
# Subir cobertura como artifact para que otros jobs lo usen
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
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: Download coverage artifact
uses: actions/download-artifact@v5
with:
name: coverage-report
path: coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
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@v5
with:
fetch-depth: 0

- name: Download coverage artifact
uses: actions/download-artifact@v5
with:
name: coverage-report
path: coverage

- name: Analyze with SonarQube / SonarCloud
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/node-test.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-24.04", "macos-14", "windows-2022"]
node-version: [20.x, 22.x, 24.x]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule
# at https://nodejs.org/en/about/releases/

Expand Down