Files
xen/automation/scripts/eclair
T
Stefano Stabellini 449caecbdf automation: fix eclair gitlab jobs for merge requests
The "eclair" script calls action_push.sh even for merge request, while
instead action_pull_request.sh should be called, resulting in a job
failure with this error:

Unexpected event pull_request

Fix the script to call action_pull_request.sh appropriately.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Simone Ballarin <simone.ballarin@bugseng.com>
2024-08-06 12:29:05 -07:00

37 lines
1.2 KiB
Bash
Executable File

#!/bin/sh -eu
ECLAIR_ANALYSIS_DIR=automation/eclair_analysis
ECLAIR_DIR="${ECLAIR_ANALYSIS_DIR}/ECLAIR"
ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
"${ECLAIR_ANALYSIS_DIR}/prepare.sh" "${VARIANT}"
ex=0
"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
"ECLAIR analysis log" \
"${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
"${ex}"
"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
"ECLAIR report log" \
"${ECLAIR_OUTPUT_DIR}/REPORT.log" \
"${ex}"
[ "${ex}" = 0 ] || exit "${ex}"
# Fail in case of new reports for clean guidelines
"${ECLAIR_DIR}/action_check_clean_regressions.sh" "${ECLAIR_OUTPUT_DIR}" || ex=$?
case "${CI_PIPELINE_SOURCE}" in
merge_request_event)
"${ECLAIR_DIR}/action_pull_request.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
;;
push | pipeline | web | schedule)
"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
;;
*)
echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
ex=1
;;
esac
[ "${ex}" = 0 ] || exit "${ex}"