fix: Improve handling from exit codes

This commit is contained in:
2025-09-24 09:17:10 -05:00
parent 6b40037e41
commit 3a9bd3a6ab

View File

@@ -55,9 +55,11 @@ runs:
# Clone the repository with fallback for branch
if git clone --depth 1 --branch "${{ inputs.BEC_PLUGIN_REPO_BRANCH }}" "${{ inputs.BEC_PLUGIN_REPO_URL }}" | tee -a "$LOG_FILE"; then
rc=${PIPESTATUS[0]}
echo "Successfully cloned with branch ${{ inputs.BEC_PLUGIN_REPO_BRANCH }}" | tee -a "$LOG_FILE"
else
echo "Failed to clone with branch ${{ inputs.BEC_PLUGIN_REPO_BRANCH }}, trying without specific branch" | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
git clone --depth 1 "${{ inputs.BEC_PLUGIN_REPO_URL }}" | tee -a "$LOG_FILE"
fi
@@ -67,8 +69,9 @@ runs:
echo "PLUGIN_REPO_NAME=${PLUGIN_REPO_NAME}" >> $GITHUB_ENV #$GITEA_ENV
echo "Plugin repository name: $PLUGIN_REPO_NAME"
echo "Exit Code: 0" >> $LOG_FILE
echo "Completed BEC Plugin Repo checkout"
echo "Exit Code: $rc" >> $LOG_FILE
- name: Checkout BEC Core
shell: bash
@@ -91,14 +94,16 @@ runs:
# Clone the repository with fallback for branch
if git clone --depth 1 --branch "${{ inputs.BEC_CORE_BRANCH }}" https://github.com/bec-project/bec.git | tee -a "$LOG_FILE"; then
rc=${PIPESTATUS[0]}
echo "Successfully cloned with branch ${{ inputs.BEC_CORE_BRANCH }}" | tee -a "$LOG_FILE"
else
echo "Failed to clone with branch ${{ inputs.BEC_CORE_BRANCH }}, trying without specific branch" | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
git clone --depth 1 https://github.com/bec-project/bec.git | tee -a "$LOG_FILE"
fi
echo "Exit Code: 0" >> $LOG_FILE
echo "Completed BEC Core checkout"
echo "Exit Code: $rc" >> $LOG_FILE
cd ../
@@ -123,15 +128,16 @@ runs:
# Clone the repository with fallback for branch
if git clone --depth 1 --branch "${{ inputs.OPHYD_DEVICES_BRANCH }}" https://github.com/bec-project/ophyd_devices.git | tee -a "$LOG_FILE"; then
rc=${PIPESTATUS[0]}
echo "Successfully cloned with branch ${{ inputs.OPHYD_DEVICES_BRANCH }}" | tee -a "$LOG_FILE"
else
echo "Failed to clone with branch ${{ inputs.OPHYD_DEVICES_BRANCH }}, trying without specific branch" | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
git clone --depth 1 https://github.com/bec-project/ophyd_devices.git | tee -a "$LOG_FILE"
fi
echo "Exit Code: 0" >> $LOG_FILE
echo "Completed Ophyd Devices checkout"
echo "Exit Code: $rc" >> $LOG_FILE
cd ../
@@ -157,15 +163,16 @@ runs:
# Clone the repository with fallback for branch
if git clone --depth 1 --branch "${{ inputs.BEC_WIDGETS_BRANCH }}" https://github.com/bec-project/bec_widgets.git | tee -a "$LOG_FILE"; then
rc=${PIPESTATUS[0]}
echo "Successfully cloned with branch ${{ inputs.BEC_WIDGETS_BRANCH }}" | tee -a "$LOG_FILE"
else
echo "Failed to clone with branch ${{ inputs.BEC_WIDGETS_BRANCH }}, trying without specific branch" | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
git clone --depth 1 https://github.com/bec-project/bec_widgets.git | tee -a "$LOG_FILE"
fi
echo "Exit Code: 0" >> $LOG_FILE
echo "Completed BEC Widgets checkout"
echo "Exit Code: $rc" >> $LOG_FILE
cd ../
- name: Install APT_PACKAGES
@@ -182,10 +189,16 @@ runs:
echo "Installing additional APT packages: ${{ inputs.APT_PACKAGES }}" | tee -a "$LOG_FILE"
sudo apt-get update | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
if [ $rc -ne 0 ]; then
echo "Exit Code: $rc" >> $LOG_FILE
exit $rc
fi
sudo apt-get install -y ${{ inputs.APT_PACKAGES }} | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
echo "Exit Code: 0" >> $LOG_FILE
echo "Completed APT package installation"
echo "Exit Code: $rc" >> $LOG_FILE
- name: Setup Python
uses: actions/setup-python@v4
@@ -211,16 +224,42 @@ runs:
# Install Core dependencies
pip install uv | tee -a "$LOG_FILE"
uv pip install --system -e ./_bec_checkout_/bec/bec_lib/[dev] | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
if [ $rc -ne 0 ]; then
echo "Exit Code: $rc" >> $LOG_FILE
exit $rc
fi
uv pip install --system -e ./_bec_checkout_/bec/bec_ipython_client | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
if [ $rc -ne 0 ]; then
echo "Exit Code: $rc" >> $LOG_FILE
exit $rc
fi
uv pip install --system -e ./_bec_checkout_/bec/bec_server[dev] | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
if [ $rc -ne 0 ]; then
echo "Exit Code: $rc" >> $LOG_FILE
exit $rc
fi
uv pip install --system -e ./_bec_widgets_checkout_/bec_widgets[dev,pyside6] | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
if [ $rc -ne 0 ]; then
echo "Exit Code: $rc" >> $LOG_FILE
exit $rc
fi
uv pip install --system -e ./_ophyd_devices_checkout_/ophyd_devices[dev] | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
if [ $rc -ne 0 ]; then
echo "Exit Code: $rc" >> $LOG_FILE
exit $rc
fi
# plugin repo name was stored earlier
source $GITHUB_ENV
pip install -e "./_plugin_checkout_/${PLUGIN_REPO_NAME}[dev]" | tee -a "$LOG_FILE"
rc=${PIPESTATUS[0]}
echo "Exit Code: 0" >> $LOG_FILE
echo "Exit Code: $rc" >> $LOG_FILE
echo "Completed Python dependencies installation"
- name: Run pytest for Plugin