|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + prolog: |
| 11 | + name: SWI-Prolog Tests |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Install SWI-Prolog |
| 17 | + run: | |
| 18 | + sudo apt-get update -qq |
| 19 | + sudo apt-get install -y swi-prolog |
| 20 | +
|
| 21 | + - name: Load check — all Prolog files |
| 22 | + run: | |
| 23 | + for f in \ |
| 24 | + unidad1/tema1.3/curp_logico.pl \ |
| 25 | + unidad3/tema3.1/hechos_consultas.pl \ |
| 26 | + unidad3/tema3.2/reglas_negacion.pl \ |
| 27 | + unidad3/tema3.3/unificacion.pl \ |
| 28 | + unidad3/tema3.4/listas.pl \ |
| 29 | + unidad3/tema3.4/aritmetica.pl \ |
| 30 | + unidad3/tema3.5/sistema_experto/diagnostico.pl \ |
| 31 | + unidad4/tema4.1/modulos_prolog.pl \ |
| 32 | + unidad4/tema4.2/busqueda_dfs.pl \ |
| 33 | + unidad4/tema4.2/busqueda_bfs.pl \ |
| 34 | + unidad4/tema4.2/estrategias.pl \ |
| 35 | + unidad4/tema4.3/clpfd_basico.pl \ |
| 36 | + unidad4/tema4.3/sudoku.pl \ |
| 37 | + unidad4/tema4.3/horarios_tec.pl \ |
| 38 | + unidad4/tema4.4/proyecto_final/validador.pl; do |
| 39 | + echo "Checking $f..." |
| 40 | + swipl -g halt -l "$f" |
| 41 | + done |
| 42 | +
|
| 43 | + - name: Run plunit test suites |
| 44 | + run: | |
| 45 | + echo "=== curp_logico (8 tests) ===" |
| 46 | + swipl -g "run_tests, halt" -l unidad1/tema1.3/curp_logico.pl |
| 47 | +
|
| 48 | + echo "=== unificacion (15 tests) ===" |
| 49 | + swipl -g "run_tests, halt" -l unidad3/tema3.3/unificacion.pl |
| 50 | +
|
| 51 | + echo "=== listas (28 tests) ===" |
| 52 | + swipl -g "run_tests, halt" -l unidad3/tema3.4/listas.pl |
| 53 | +
|
| 54 | + echo "=== aritmetica (48 tests) ===" |
| 55 | + swipl -g "run_tests, halt" -l unidad3/tema3.4/aritmetica.pl |
| 56 | +
|
| 57 | + erlang: |
| 58 | + name: Erlang Compilation |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + |
| 63 | + - name: Install Erlang/OTP |
| 64 | + run: | |
| 65 | + sudo apt-get update -qq |
| 66 | + sudo apt-get install -y erlang |
| 67 | +
|
| 68 | + - name: Compile all Erlang files |
| 69 | + run: | |
| 70 | + mkdir -p /tmp/ebin |
| 71 | + for f in \ |
| 72 | + unidad1/tema1.3/curp_funcional.erl \ |
| 73 | + unidad2/tema2.1/inmutabilidad.erl \ |
| 74 | + unidad2/tema2.1/patron_matching.erl \ |
| 75 | + unidad2/tema2.5/sensor_supervisor/src/sensor_app.erl \ |
| 76 | + unidad2/tema2.5/sensor_supervisor/src/sensor_sup.erl \ |
| 77 | + unidad2/tema2.5/sensor_supervisor/src/sensor_server.erl; do |
| 78 | + echo "Compiling $f..." |
| 79 | + erlc -o /tmp/ebin "$f" |
| 80 | + done |
| 81 | +
|
| 82 | + haskell: |
| 83 | + name: Haskell Type Check |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v4 |
| 87 | + |
| 88 | + - name: Install GHC |
| 89 | + run: | |
| 90 | + sudo apt-get update -qq |
| 91 | + sudo apt-get install -y ghc |
| 92 | +
|
| 93 | + - name: Type-check Haskell files |
| 94 | + run: | |
| 95 | + for f in \ |
| 96 | + unidad2/tema2.3/recursion.hs \ |
| 97 | + unidad2/tema2.4/lazy.hs; do |
| 98 | + echo "Checking $f..." |
| 99 | + ghc -fno-code "$f" |
| 100 | + done |
0 commit comments