-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,31 @@ jobs: | |
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
|
||
# Instalar una versión específica de pnpm dependiendo de la versión de Node.js | ||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
run: | | ||
if [[ "${{ matrix.node-version }}" == "16" ]]; then | ||
npm install -g pnpm@7 # Versión compatible con Node.js 16.x | ||
else | ||
npm install -g pnpm@9 # Para Node.js 18.x y superiores | ||
fi | ||
# Verificar si el archivo pnpm-lock.yaml existe, y manejar instalación dependiendo de su presencia | ||
- name: Install Dependencies | ||
run: pnpm install --frozen-lockfile | ||
run: | | ||
if [ -f pnpm-lock.yaml ]; then | ||
echo "pnpm-lock.yaml encontrado, ejecutando instalación con frozen lockfile" | ||
pnpm install --prefer-frozen-lockfile || pnpm install | ||
else | ||
echo "pnpm-lock.yaml no encontrado, ejecutando instalación normal" | ||
pnpm install | ||
fi | ||
# Ejecutar las pruebas con Jest | ||
- name: Run Jest Tests with Coverage | ||
run: pnpm test -- --coverage | ||
|
||
# Generar reporte de cobertura de código | ||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
with: | ||
|
@@ -42,6 +58,7 @@ jobs: | |
output: both | ||
thresholds: "60 80" | ||
|
||
# Subir artefacto de cobertura | ||
- name: Upload Coverage Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
|