Aggiornamento file yaml per l aggiunta di report
All checks were successful
Punisher CI/CD Full Monitor / build-and-test (push) Successful in 29s

This commit is contained in:
boloilking
2026-02-17 18:05:19 +01:00
parent abfea62a7a
commit b823336eef

View File

@@ -1,4 +1,4 @@
name: Punisher CI/CD Advanced name: Punisher CI/CD Full Monitor
on: [push] on: [push]
jobs: jobs:
@@ -6,34 +6,32 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: catthehacker/ubuntu:act-latest image: catthehacker/ubuntu:act-latest
options: --memory=128mb --cpus=0.5 # Limite di sicurezza per la VPS options: --memory=128mb --cpus=0.5
steps: steps:
- name: Checkout del codice - name: Checkout del codice
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup Strumenti di Analisi - name: Installazione Tool SOC
run: | run: apt-get update && apt-get install -y build-essential valgrind curl
apt-get update
apt-get install -y build-essential valgrind curl
- name: Compilazione Professionale - name: Compilazione
run: make build run: make build
- name: Analisi Memoria e Esecuzione Sandbox - name: Esecuzione Sandbox con Valgrind
# Valgrind monitora ogni byte allocato. Se superi i 128MB o sballi un puntatore, lo vedrai qui. # Eseguiamo e salviamo tutto in un file
run: | run: |
valgrind --leak-check=full \ valgrind --leak-check=full --log-file=v_report.txt ./lab_app > app_output.log 2>&1 || true
--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 - name: Invio Report Finale
# Inviamo sia l'output del programma che il report della memoria if: always()
if: always() # Eseguito anche se il codice crasha
run: | run: |
LOG_CONTENT=$(cat output.log valgrind_report.txt | base64 -w 0) # Uniamo i log in un unico report leggibile
echo "--- OUTPUT PROGRAMMA ---" > final.txt
cat app_output.log >> final.txt
echo -e "\n\n--- ANALISI VALGRIND ---" >> final.txt
cat v_report.txt >> final.txt
# Spediamo tutto codificato a n8n
curl -X POST -H "Content-Type: application/json" \ curl -X POST -H "Content-Type: application/json" \
-d "{\"project\":\"${{ github.repository }}\", \"status\":\"finished\", \"log\":\"$LOG_CONTENT\"}" \ -d "{\"log\":\"$(cat final.txt | base64 -w 0)\"}" \
https://n8n.thepunisher-lab.duckdns.org/webhook/LOG_REPORT_ID https://n8n.thepunisher-lab.duckdns.org/webhook/punisher-logs