From abfea62a7af4843f725b96f8996f59a69c1e8ae5 Mon Sep 17 00:00:00 2001 From: boloilking Date: Tue, 17 Feb 2026 15:59:59 +0100 Subject: [PATCH] Fix yaml runner --- .gitea/workflows/deploy.yaml | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 9a868c7..c785985 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,22 +1,39 @@ -name: Punisher CI/CD +name: Punisher CI/CD Advanced on: [push] jobs: build-and-test: runs-on: ubuntu-latest container: - # Questa immagine รจ lo standard professionale per i runner Gitea/Act image: catthehacker/ubuntu:act-latest - options: --memory=128mb --cpus=0.5 + options: --memory=128mb --cpus=0.5 # Limite di sicurezza per la VPS steps: - name: Checkout del codice uses: actions/checkout@v3 - - name: Installazione dipendenze (se mancano) - run: apt-get update && apt-get install -y build-essential + - name: Setup Strumenti di Analisi + run: | + apt-get update + apt-get install -y build-essential valgrind curl - name: Compilazione Professionale run: make build - - name: Esecuzione Sandbox - run: make run \ No newline at end of file + - name: Analisi Memoria e Esecuzione Sandbox + # Valgrind monitora ogni byte allocato. Se superi i 128MB o sballi un puntatore, lo vedrai qui. + run: | + valgrind --leak-check=full \ + --show-leak-kinds=all \ + --track-origins=yes \ + --verbose \ + --log-file=valgrind_report.txt \ + ./lab_app > output.log 2>&1 || echo "CRASH DETECTED" >> output.log + + - name: Invio Report a n8n + # Inviamo sia l'output del programma che il report della memoria + if: always() # Eseguito anche se il codice crasha + run: | + LOG_CONTENT=$(cat output.log valgrind_report.txt | base64 -w 0) + curl -X POST -H "Content-Type: application/json" \ + -d "{\"project\":\"${{ github.repository }}\", \"status\":\"finished\", \"log\":\"$LOG_CONTENT\"}" \ + https://n8n.thepunisher-lab.duckdns.org/webhook/LOG_REPORT_ID \ No newline at end of file