Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroGlezC authored Apr 24, 2024
1 parent 5040d58 commit 936042b
Showing 1 changed file with 7 additions and 24 deletions.
31 changes: 7 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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

0 comments on commit 936042b

Please sign in to comment.