diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7f0b66..77c04cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,19 +23,13 @@ jobs: - name: Build with Maven run: mvn clean verify - - # - name: Generate JaCoCo Badge - # uses: cicirello/jacoco-badge-generator@v2 - # with: - # generate-branches-badge: true - # jacoco-csv-file: SYG-bootstrap/target/site/jacoco-aggregate/jacoco.csv - # coverage-label: coverage # Mover el reporte de cobertura a la raĆ­z del proyecto - name: Move coverage report to project root run: | mkdir -p coverage - cp -r SYG-bootstrap/target/site/jacoco-aggregate/* coverage/ + cp -r SYG-bootstrap/target/site/jacoco-aggregate/jacoco.csv coverage/ + cp -r SYG-bootstrap/target/site/jacoco-aggregate/index.html coverage/ - name: Configurar Git para el commit run: | @@ -48,20 +42,9 @@ jobs: git commit -m "Agregar reporte de cobertura" git push - - name: Obtener cobertura - id: obtener-cobertura - run: | - cobertura=$(awk '/^TOTAL/{print $NF}' SYG-bootstrap/target/site/jacoco/index.html) - echo "::set-output name=cobertura::$cobertura" - - - name: Generar badge de cobertura - run: | - curl -o backend-coverage-badge.svg "https://img.shields.io/badge/backend%20cobertura-${{ steps.obtener-cobertura.outputs.cobertura }}%25-green" - - - name: Guardar badge en el repositorio - run: | - git add -f backend-coverage-badge.svg - git commit -m "Agregar badge de cobertura del backend" - git push - + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: SYG-bootstrap/target/site/jacoco-aggregate/jacoco.xml