pruebas automatica intento 90000 -> clang en vez de msvc #29
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
name: Pruebas | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**.hpp' | |
- '**.cpp' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '**.hpp' | |
- '**.cpp' | |
jobs: | |
construir-y-probar: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Instalar Clang 19.1.4 | |
run: | | |
# Download and install LLVM/Clang 19.1.4 from the official LLVM website | |
mkdir clang-19.1.4 | |
cd clang-19.1.4 | |
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.4/clang+llvm-19.1.4-x86_64-windows-msvc.tar.xz | |
tar -xf clang+llvm-19.1.4-x86_64-windows-msvc.tar.xz | |
echo "LLVM and Clang installed to $(pwd)" | |
- name: Configurar CMake con Clang 19.1.4 y C++20 | |
run: | | |
# Set environment variables for Clang 19.1.4 | |
set CXX=%CD%\clang-19.1.4\clang+llvm-19.1.4-x86_64-windows-msvc\bin\clang++ | |
set CC=%CD%\clang-19.1.4\clang+llvm-19.1.4-x86_64-windows-msvc\bin\clang | |
echo "CXX and CC are set to Clang 19.1.4" | |
# Configure the project with CMake using Clang and C++20 | |
cmake -S . -B build -DCMAKE_C_COMPILER=%CC% -DCMAKE_CXX_COMPILER=%CXX% -DCMAKE_CXX_STANDARD=20 | |
- name: Compilar | |
run: | | |
cmake --build build | |
- name: Ejecutar Pruebas | |
id: ejecutar_pruebas | |
run: | | |
build\correr_pruebas.exe -s | |
- name: Publicar Resultados de Pruebas (en caso de fallos) | |
if: failure() | |
run: | | |
echo "Resultados de las pruebas:" | |
type build\Testing\Temporary\LastTest.log | |
- name: Actualizar Descripción de PR o Commit | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
// Determinar el resultado de las pruebas | |
const testOutcome = context.payload.workflow_run.conclusion === 'success' ? | |
'✔ Todas las pruebas pasaron correctamente.' : | |
'❌ Las pruebas fallaron.'; | |
const comment = `Resultado de las pruebas:\n\n${testOutcome}`; | |
// Actualizar la descripción del pull request si es un PR | |
if (context.payload.pull_request) { | |
await github.rest.pulls.update({ | |
...context.repo, | |
pull_number: context.payload.pull_request.number, | |
body: (context.payload.pull_request.body || '') + `\n\n${comment}`, | |
}); | |
} else { | |
// Agregar un mensaje de estado para commits directos | |
await github.rest.repos.createCommitStatus({ | |
...context.repo, | |
sha: context.sha, | |
state: testOutcome.includes('✔') ? 'success' : 'failure', | |
description: testOutcome, | |
context: 'Resultados de las pruebas', | |
}); | |
} |