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
57 changes: 57 additions & 0 deletions .github/workflows/make-coverage-html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# yamllint disable rule:line-length
# This workflow runs make coverage/html and verifies that the coverage HTML report is generated.
# yamllint enable rule:line-length

---
name: Make Coverage HTML

env:
REPORT_DIR: "coverage/lcov-report"
REPORT_FILE: "index.html"

on: # yamllint disable-line rule:truthy
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

jobs:
make-coverage-html:
name: "Run make coverage/html and verify coverage HTML"
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24.x

- name: Tool test
run: |
echo "Node.js version:"
node --version
echo "GNU make version:"
make --version

- name: Run coverage HTML target
run: make coverage/html

- name: Verify coverage HTML artifact
shell: bash
run: |
if [ ! -f $REPORT_DIR/$REPORT_FILE ]; then
echo "Coverage HTML file not found: $REPORT_DIR/$REPORT_FILE"
exit 1
fi
if [ ! -s $REPORT_DIR/$REPORT_FILE ]; then
echo "Coverage HTML file is empty: $REPORT_DIR/$REPORT_FILE"
exit 1
fi

- name: Upload coverage HTML artifact
uses: actions/upload-artifact@v7
with:
name: coverage-report-html
path: ${{ env.REPORT_DIR }}
19 changes: 12 additions & 7 deletions .github/workflows/node-coverage.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,26 @@ jobs:
with:
node-version: 24.x

- name: Install dependencies
run: npm ci --verbose
- name: Tool test
run: |
echo "Node.js version:"
node --version
echo "GNU make version:"
make --version

- name: Lint
run: npm run lint
- name: Install dependencies
run: make dependencies

- name: Run the tests
run: npm run jest:ci -- --coverage
- name: Run the tests with coverage
run: make coverage

# Subir cobertura como artifact para que otros jobs lo usen
- name: Upload coverage artifact
uses: actions/upload-artifact@v7

with:
name: coverage-report
path: coverage # o la carpeta donde jest genera los reportes
path: coverage


codecov:
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ test: env dependencies
coverage: test

coverage/html: coverage
open coverage/lcov-report/index.html
@if [ "$$(uname)" = "Darwin" ]; then \
open ./coverage/lcov-report/index.htmll; \
elif [ "$$(uname | tr '[:upper:]' '[:lower:]')" = "mingw32" ] || [ "$$(uname | tr '[:upper:]' '[:lower:]')" = "mingw64" ] || [ "$$(uname | tr '[:upper:]' '[:lower:]')" = "cygwin" ]; then \
cmd /c start ./coverage/lcov-report/index.htmll; \
else \
echo "Coverage HTML generated: ./coverage/lcov-report/index.htmll"; \
fi

outdated:
-npm outdated
Expand Down