Pruebas #18
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 | |
- name: Clonar Catch2 | |
run: git clone https://github.com/catchorg/Catch2.git externos/Catch2 | |
- name: Compilar | |
run: | | |
cmake -S . -B compilar -DCATCH2_DIR="${GITHUB_WORKSPACE}/externos/Catch2" | |
cmake --build compilar | |
- name: EjecutarPruebas | |
id: test | |
run: | | |
compilar\correr_pruebas.exe -s | |
- name: VerificarResultadosPruebas | |
if: steps.test.outcome != 'success' | |
run: | | |
echo "::set-output name=test_output::$(cat $GITHUB_WORKSPACE/build/Testing/Temporary/LastTest.log)" | |
- name: EstablecerEstadoPR | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const result = ${{ steps.test.outcome }}; | |
const output = result == 'success' ? 'Las pruebas pasaron correctamente' : context.workflow.steps.check_test_result.outputs.test_output; | |
github.rest.repos.createCommitStatus({ | |
...context.repo, | |
sha: context.sha, | |
state: result, | |
description: output, | |
context: 'Resultados de las pruebas' | |
}); |