-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.77 KB
/
pruebas.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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',
});
}