All checks were successful
Punisher CI/CD Advanced / build-and-test (push) Successful in 42s
39 lines
1.4 KiB
YAML
39 lines
1.4 KiB
YAML
name: Punisher CI/CD Advanced
|
|
on: [push]
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
options: --memory=128mb --cpus=0.5 # Limite di sicurezza per la VPS
|
|
steps:
|
|
- name: Checkout del codice
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Strumenti di Analisi
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y build-essential valgrind curl
|
|
|
|
- name: Compilazione Professionale
|
|
run: make build
|
|
|
|
- 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 |