File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # yamllint disable rule:line-length
2+ # This workflow runs make coverage/html and verifies that the coverage HTML report is generated.
3+ # yamllint enable rule:line-length
4+
5+ ---
6+ name : Make Coverage HTML
7+
8+ env :
9+ REPORT_DIR : " coverage/lcov-report"
10+ REPORT_FILE : " index.html"
11+
12+ on : # yamllint disable-line rule:truthy
13+ push :
14+ branches : ["main"]
15+ pull_request :
16+ branches : ["main"]
17+ workflow_dispatch :
18+
19+ jobs :
20+ make-coverage-html :
21+ name : " Run make coverage/html and verify coverage HTML"
22+ runs-on : ubuntu-24.04
23+
24+ steps :
25+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
26+ - name : Set up Node.js
27+ uses : actions/setup-node@v6
28+ with :
29+ node-version : 24.x
30+
31+ - name : Tool test
32+ run : |
33+ echo "Node.js version:"
34+ node --version
35+ echo "GNU make version:"
36+ make --version
37+
38+ - name : Run coverage HTML target
39+ run : make coverage/html
40+
41+ - name : Verify coverage HTML artifact
42+ shell : bash
43+ run : |
44+ if [ ! -f $REPORT_DIR/$REPORT_FILE ]; then
45+ echo "Coverage HTML file not found: $REPORT_DIR/$REPORT_FILE"
46+ exit 1
47+ fi
48+ if [ ! -s $REPORT_DIR/$REPORT_FILE ]; then
49+ echo "Coverage HTML file is empty: $REPORT_DIR/$REPORT_FILE"
50+ exit 1
51+ fi
52+
53+ - name : Upload coverage HTML artifact
54+ uses : actions/upload-artifact@v7
55+ with :
56+ name : coverage-report-html
57+ path : ${{ env.REPORT_DIR }}
Original file line number Diff line number Diff line change @@ -24,21 +24,26 @@ jobs:
2424 with :
2525 node-version : 24.x
2626
27- - name : Install dependencies
28- run : npm ci --verbose
27+ - name : Tool test
28+ run : |
29+ echo "Node.js version:"
30+ node --version
31+ echo "GNU make version:"
32+ make --version
2933
30- - name : Lint
31- run : npm run lint
34+ - name : Install dependencies
35+ run : make dependencies
3236
33- - name : Run the tests
34- run : npm run jest:ci -- -- coverage
37+ - name : Run the tests with coverage
38+ run : make coverage
3539
3640 # Subir cobertura como artifact para que otros jobs lo usen
3741 - name : Upload coverage artifact
3842 uses : actions/upload-artifact@v7
43+
3944 with :
4045 name : coverage-report
41- path : coverage # o la carpeta donde jest genera los reportes
46+ path : coverage
4247
4348
4449 codecov :
Original file line number Diff line number Diff line change @@ -94,7 +94,13 @@ test: env dependencies
9494coverage : test
9595
9696coverage/html : coverage
97- open coverage/lcov-report/index.html
97+ @if [ " $$ (uname)" = " Darwin" ]; then \
98+ open ./coverage/lcov-report/index.htmll; \
99+ elif [ " $$ (uname | tr '[:upper:]' '[:lower:]')" = " mingw32" ] || [ " $$ (uname | tr '[:upper:]' '[:lower:]')" = " mingw64" ] || [ " $$ (uname | tr '[:upper:]' '[:lower:]')" = " cygwin" ]; then \
100+ cmd /c start ./coverage/lcov-report/index.htmll; \
101+ else \
102+ echo " Coverage HTML generated: ./coverage/lcov-report/index.htmll" ; \
103+ fi
98104
99105outdated :
100106 -npm outdated
You can’t perform that action at this time.
0 commit comments