Skip to content

Merge branch 'main' of https://github.com/MeaCore-Enterprise/MeaCode-… #11

Merge branch 'main' of https://github.com/MeaCore-Enterprise/MeaCode-…

Merge branch 'main' of https://github.com/MeaCore-Enterprise/MeaCode-… #11

Workflow file for this run

name: Tests — Windows
# Corre los tests de Rust y frontend en cada PR y push a ramas principales.
# Solo Windows. Linux se añadirá en el futuro.
on:
pull_request:
branches: [main, master, develop]
push:
branches: [main, master, develop]
tags-ignore:
- 'v*'
- '*.*.*'
# Los tests de PR se cancelan si llega un push nuevo al mismo branch.
concurrency:
group: test-${{ github.ref }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
test-windows:
name: Tests — Windows x64
runs-on: windows-latest
permissions:
contents: read
steps:
# ─── 1. CHECKOUT ────────────────────────────────────────────────────────
- name: Checkout repository
uses: actions/checkout@v4
# ─── 2. TOOLCHAIN — NODE + PNPM ─────────────────────────────────────────
- name: Setup Node.js 20 LTS
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ env.PNPM_HOME }}\store
key: windows-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
windows-pnpm-
# ─── 3. TOOLCHAIN — RUST ────────────────────────────────────────────────
- name: Setup Rust stable (x86_64-pc-windows-msvc)
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
components: clippy
- name: Cache Cargo registry + build artifacts
uses: actions/cache@v4
with:
path: |
~\.cargo\registry
~\.cargo\git
src-tauri\target
key: windows-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
windows-cargo-test-
windows-cargo-
# ─── 4. INSTALAR DEPENDENCIAS ────────────────────────────────────────────
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
# ─── 5. LINT RUST ────────────────────────────────────────────────────────
# Clippy detecta errores comunes en Rust sin compilar el binario final.
- name: Lint Rust (clippy)
shell: pwsh
run: |
Set-Location src-tauri
cargo clippy --target x86_64-pc-windows-msvc --lib --bins -- -D warnings
continue-on-error: true
# ─── 6. TESTS DE RUST ────────────────────────────────────────────────────
# Se ejecuta UNA sola vez y el resultado determina el estado del job.
- name: Run Rust tests
shell: pwsh
run: |
Set-Location src-tauri
$result = cargo test --target x86_64-pc-windows-msvc --lib --bins 2>&1
Write-Host $result
if ($LASTEXITCODE -eq 0) {
Write-Host "✅ Rust tests passed"
} else {
Write-Error "❌ Rust tests failed"
exit 1
}
# ─── 7. TESTS DE FRONTEND ────────────────────────────────────────────────
# Si no hay tests configurados, no falla el workflow.
- name: Run frontend tests
shell: pwsh
run: |
$result = pnpm test 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host "✅ Frontend tests passed"
} else {
Write-Host "⚠️ Frontend tests not configured or failed (non-blocking)"
Write-Host $result
}
continue-on-error: true
# ─── 8. TYPE CHECK TYPESCRIPT ────────────────────────────────────────────
- name: TypeScript type check
run: pnpm type-check