From af47480de205f9d57e5fa9974f998c81d19ade54 Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Mon, 18 Aug 2025 16:25:31 -0400 Subject: [PATCH 1/2] [REFACTOR] [Github Actions] codecov and sonarcloud now runs in parallel --- .github/workflows/node-coverage.yml | 51 ++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/.github/workflows/node-coverage.yml b/.github/workflows/node-coverage.yml index cc90bbdc..bf1e3d7a 100644 --- a/.github/workflows/node-coverage.yml +++ b/.github/workflows/node-coverage.yml @@ -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: @@ -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 }} From 0e062af7c217a3b2e7bb98e048026bf2e005f4fd Mon Sep 17 00:00:00 2001 From: Gonzalo Diaz Date: Mon, 18 Aug 2025 17:41:40 -0400 Subject: [PATCH 2/2] [REFACTOR] [Github Actions] nodejs 24.x breaks jest. Avoiding 24.x versions. --- .github/workflows/node-coverage.yml | 2 +- .github/workflows/node-test.js.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-coverage.yml b/.github/workflows/node-coverage.yml index bf1e3d7a..aa9eaffb 100644 --- a/.github/workflows/node-coverage.yml +++ b/.github/workflows/node-coverage.yml @@ -22,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 diff --git a/.github/workflows/node-test.js.yml b/.github/workflows/node-test.js.yml index 77392000..c7c2e150 100644 --- a/.github/workflows/node-test.js.yml +++ b/.github/workflows/node-test.js.yml @@ -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/