wip #1

Open
wakonig_k wants to merge 23 commits from ci/gitea_actions into main
2 changed files with 107 additions and 1 deletions

106
.gitea/workflows/ci.yml Normal file
View File

@ -0,0 +1,106 @@
name: CI Beamline
on:
push:
pull_request:
workflow_dispatch:
inputs:
BEC_WIDGETS_BRANCH:
description: "Branch of BEC Widgets to install"
required: false
type: string
BEC_CORE_BRANCH:
description: "Branch of BEC Core to install"
required: false
type: string
OPHYD_DEVICES_BRANCH:
description: "Branch of Ophyd Devices to install"
required: false
type: string
BEC_PLUGIN_REPO_BRANCH:
description: "Branch of the BEC Plugin Repository to install"
required: false
type: string
permissions:
pull-requests: write
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
env:
QTWEBENGINE_DISABLE_SANDBOX: 1
QT_QPA_PLATFORM: "offscreen"
steps:
- name: Prepare checkout directory
run: |
# Create a directory for the checkout
mkdir -p _checkout_
- name: Checkout BEC Plugin Repository
id: plugin_checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
# if: ( steps.plugin_checkout.outputs.skip_tests != 'true' )
with:
python-version: ${{ inputs.PYTHON_VERSION || '3.11' }}
- name: Checkout BEC Core
uses: actions/checkout@v4
# if: ( steps.plugin_checkout.outputs.skip_tests != 'true' )
with:
repository: bec/bec
ref: ${{ inputs.BEC_CORE_BRANCH || 'main' }}
path: ./_checkout_/bec
- name: Checkout Ophyd Devices
uses: actions/checkout@v4
# if: ( steps.plugin_checkout.outputs.skip_tests != 'true' )
with:
repository: bec/ophyd_devices
ref: ${{ inputs.OPHYD_DEVICES_BRANCH || 'main' }}
path: ./_checkout_/ophyd_devices
- name: Checkout BEC Widgets
uses: actions/checkout@v4
# if: ( steps.plugin_checkout.outputs.skip_tests != 'true' )
with:
repository: bec/bec_widgets
ref: ${{ inputs.BEC_WIDGETS_BRANCH || 'main' }}
path: ./_checkout_/bec_widgets
- name: Install dependencies
shell: bash
# if: ( steps.plugin_checkout.outputs.skip_tests != 'true' )
run: |
sudo apt-get update
sudo apt-get install -y libgl1 libegl1 x11-utils libxkbcommon-x11-0 libdbus-1-3 xvfb
sudo apt-get -y install libnss3 libxdamage1 libasound2t64 libatomic1 libxcursor1
- name: Install Python dependencies
shell: bash
# if: ( steps.plugin_checkout.outputs.skip_tests != 'true' )
run: |
pip install uv
# print the current directory to verify the structure
echo "Current directory: $(pwd)"
echo "Available directories: $(ls _checkout_)"
uv pip install --system -e ./_checkout_/ophyd_devices[dev]
uv pip install --system -e ./_checkout_/bec/bec_lib[dev]
uv pip install --system -e ./_checkout_/bec/bec_ipython_client[dev]
uv pip install --system -e ./_checkout_/bec/bec_server[dev]
uv pip install --system -e ./_checkout_/bec_widgets[dev]
uv pip install --system -e .[dev]
- name: Run Pytest
shell: bash
# if: ( steps.plugin_checkout.outputs.skip_tests != 'true' )
run: |
# echo "::group::Running Pytest"
pytest -v --maxfail=2 --random-order ./tests
# echo "::endgroup::"

View File

@ -16,7 +16,7 @@ def mock_trigger():
name = "phoenix_trigger" name = "phoenix_trigger"
prefix = "X07MB-OP2:" prefix = "X07MB-OP2:"
dm = DMMock() dm = DMMock()
with mock.patch.object(dm, "connector"): with mock.patch.object(dm, "connecto"):
with ( with (
mock.patch( mock.patch(
"ophyd_devices.interfaces.base_classes.bec_device_base.FileWriter" "ophyd_devices.interfaces.base_classes.bec_device_base.FileWriter"