33 lines
1.2 KiB
Bash
Executable File
33 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
TARGET_DIR="${1:-.}"
|
|
OUTPUT_DIR="${2:-tests/reports/agents}"
|
|
mkdir -p "$OUTPUT_DIR"
|
|
SUMMARY_FILE="$OUTPUT_DIR/compilation_agent.md"
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common.sh" || true
|
|
|
|
echo "# Agent Compilation" > "$SUMMARY_FILE"
|
|
echo >> "$SUMMARY_FILE"
|
|
|
|
pushd "$TARGET_DIR" >/dev/null
|
|
if [[ "$SCOPE" == "changed" ]]; then
|
|
relevant=(.gitea/workflows/ci.yml)
|
|
any=0; for p in "${relevant[@]}"; do if is_path_changed "$p"; then any=1; break; fi; done
|
|
if [[ $any -eq 0 ]]; then echo "- Aucun changement compilation CI (SCOPE=changed)." >> "$SUMMARY_FILE"; echo "Rapport: $SUMMARY_FILE"; popd >/dev/null; exit 0; fi
|
|
fi
|
|
if grep -q "cargo" .gitea/workflows/ci.yml 2>/dev/null; then
|
|
echo "- Étapes de build/format/clippy Rust détectées dans la CI." >> "$SUMMARY_FILE"
|
|
else
|
|
echo "- Étapes de compilation non détectées dans la CI (à ajouter si nécessaire)." >> "$SUMMARY_FILE"
|
|
fi
|
|
|
|
PROMPT=$(cat <<'EOF'
|
|
Précise une cadence de compilation (avant refactor/push, après update deps) et les conditions de blocage si erreurs.
|
|
EOF
|
|
)
|
|
scripts/agents/ai_prompt.sh "$PROMPT" >> "$SUMMARY_FILE" || true
|
|
|
|
echo "Rapport: $SUMMARY_FILE"
|
|
popd >/dev/null
|