refactor: separate actions in substructure, run as bash script
This commit is contained in:
36
checkout_repositories/action.yml
Normal file
36
checkout_repositories/action.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
name: "BEC Plugin Repository Checkout"
|
||||
description: "Install and test a BEC plugin repository"
|
||||
inputs:
|
||||
PLUGIN_REPO_NAME:
|
||||
description: "URL of the BEC Plugin Repository to install"
|
||||
required: true
|
||||
default: ""
|
||||
BEC_PLUGIN_REPO_BRANCH:
|
||||
description: "Branch of the BEC Plugin Repository to install"
|
||||
required: false
|
||||
default: "main"
|
||||
BEC_CORE_BRANCH:
|
||||
description: "Branch of BEC Core to install"
|
||||
required: false
|
||||
default: "main"
|
||||
BEC_WIDGETS_BRANCH:
|
||||
description: "Branch of BEC Widgets to install"
|
||||
required: false
|
||||
default: "main"
|
||||
OPHYD_DEVICES_BRANCH:
|
||||
description: "Branch of Ophyd Devices to install"
|
||||
required: false
|
||||
default: "main"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Checkout BEC Plugin Repository
|
||||
shell: bash
|
||||
run: |
|
||||
chmod +x run_ci.sh
|
||||
./run_ci.sh "${{ inputs.BEC_PLUGIN_REPO_URL }}" \
|
||||
"${{ inputs.BEC_PLUGIN_REPO_BRANCH }}" \
|
||||
"${{ inputs.BEC_CORE_BRANCH }}" \
|
||||
"${{ inputs.BEC_WIDGETS_BRANCH }}" \
|
||||
"${{ inputs.OPHYD_DEVICES_BRANCH }}"
|
||||
63
checkout_repositories/run_ci.sh
Normal file
63
checkout_repositories/run_ci.sh
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PLUGIN_REPO_NAME="https://gitea.psi.ch/bec/$1.git"
|
||||
PLUGIN_BRANCH="$2"
|
||||
CORE_BRANCH="$3"
|
||||
WIDGETS_BRANCH="$4"
|
||||
OPHYD_DEVICES_BRANCH="$5"
|
||||
|
||||
echo "--- Repository checkouts begin ---"
|
||||
|
||||
# --- Step 1: Checkout Plugin ---
|
||||
echo "=== Checkout BEC Plugin ==="
|
||||
mkdir -p ./_plugin_checkout_/
|
||||
cd ./_plugin_checkout_/
|
||||
if git clone --depth 1 --branch "$PLUGIN_BRANCH" "$PLUGIN_URL" plugin_repo; then
|
||||
echo "Plugin checkout successful"
|
||||
else
|
||||
echo "Plugin checkout failed, trying default branch"
|
||||
git clone --depth 1 "$PLUGIN_URL" plugin_repo
|
||||
fi
|
||||
cd ..
|
||||
|
||||
# --- Step 2: Checkout Core ---
|
||||
echo "=== Checkout BEC Core ==="
|
||||
mkdir -p ./_bec_checkout_/
|
||||
cd ./_bec_checkout_/
|
||||
if git clone --depth 1 --branch "$CORE_BRANCH" https://github.com/bec-project/bec.git bec_core; then
|
||||
echo "Core checkout successful"
|
||||
else
|
||||
echo "Core checkout failed, trying default branch"
|
||||
git clone --depth 1 https://github.com/bec-project/bec.git bec_core
|
||||
fi
|
||||
|
||||
cd ..
|
||||
|
||||
# --- Step 3: Checkout Widgets ---
|
||||
echo "=== Checkout BEC Widgets ==="
|
||||
mkdir -p ./_bec_widgets_checkout_/
|
||||
cd ./_bec_widgets_checkout_/
|
||||
if git clone --depth 1 --branch "$WIDGETS_BRANCH" https://github.com/bec-project/bec-widgets.git bec_widgets; then
|
||||
echo "Widgets checkout successful"
|
||||
else
|
||||
echo "Widgets checkout failed, trying default branch"
|
||||
git clone --depth 1 https://github.com/bec-project/bec-widgets.git bec_widgets
|
||||
fi
|
||||
|
||||
cd ..
|
||||
|
||||
# --- Step 4: Checkout Ophyd Devices ---
|
||||
echo "=== Checkout Ophyd Devices ==="
|
||||
mkdir -p ./_ophyd_devices_checkout_/
|
||||
cd ./_ophyd_devices_checkout_/
|
||||
if git clone --depth 1 --branch "$OPHYD_DEVICES_BRANCH" https://github.com/bec-project/bec-ophyd-devices.git bec_ophyd_devices; then
|
||||
echo "Ophyd Devices checkout successful"
|
||||
else
|
||||
echo "Ophyd Devices checkout failed, trying default branch"
|
||||
git clone --depth 1 https://github.com/bec-project/bec-ophyd-devices.git bec_ophyd_devices
|
||||
fi
|
||||
|
||||
cd ..
|
||||
|
||||
echo "--- All checkouts complete ---"
|
||||
Reference in New Issue
Block a user