All checks were successful
Punisher CI/CD Final Monitor / build-and-test (push) Successful in 29s
39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
name: Punisher CI/CD Final Monitor
|
|
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 VPS
|
|
steps:
|
|
- name: Checkout del codice
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup SOC Tools
|
|
run: apt-get update && apt-get install -y build-essential valgrind curl
|
|
|
|
- name: Compilazione Professionale
|
|
run: make build
|
|
|
|
- name: Analisi Valgrind e Sandbox
|
|
# Usiamo 'tee' per vedere i log sia su Gitea che nel file
|
|
run: |
|
|
valgrind --leak-check=full --log-file=v_report.txt ./lab_app 2>&1 | tee output.log || true
|
|
|
|
- name: Spedizione Report a n8n
|
|
if: always()
|
|
run: |
|
|
echo "--- LOG PROGRAMMA ---" > final.txt
|
|
cat output.log >> final.txt
|
|
echo -e "\n\n--- ANALISI MEMORIA VALGRIND ---" >> final.txt
|
|
cat v_report.txt >> final.txt
|
|
|
|
# Creiamo un file JSON temporaneo per evitare errori di caratteri speciali
|
|
JOBS_LOG=$(cat final.txt | base64 -w 0)
|
|
echo "{\"log\":\"$JOBS_LOG\"}" > payload.json
|
|
|
|
curl -X POST -H "Content-Type: application/json" \
|
|
-d @payload.json \
|
|
https://n8n.thepunisher-lab.duckdns.org/webhook/punisher-logs |