From 9d456a0341726fcb388de646cadd3354513a40b8 Mon Sep 17 00:00:00 2001 From: appel_c Date: Thu, 12 Jun 2025 08:57:16 +0200 Subject: [PATCH] ci: add bec pipeline to ophyd_devices --- .github/workflows/child_repos.yml | 64 +++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 8 ++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/child_repos.yml diff --git a/.github/workflows/child_repos.yml b/.github/workflows/child_repos.yml new file mode 100644 index 0000000..8ffab36 --- /dev/null +++ b/.github/workflows/child_repos.yml @@ -0,0 +1,64 @@ +name: Run Pytest with Coverage +on: + workflow_call: + inputs: + BEC_CORE_BRANCH: + description: 'Branch for BEC Core' + required: false + default: 'main' + type: string + OPHYD_DEVICES_BRANCH: + description: 'Branch for Ophyd Devices' + required: false + default: 'main' + type: string + BEC_WIDGETS_BRANCH: + description: 'Branch for BEC Widgets' + required: false + default: 'main' + type: string + + +jobs: + bec: + name: BEC Unit Tests + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + + steps: + - name: Checkout BEC + uses: actions/checkout@v4 + with: + repository: bec-project/bec + ref: ${{ inputs.BEC_CORE_BRANCH }} + + - name: Install BEC and dependencies + uses: ./.github/actions/bec_install + with: + BEC_CORE_BRANCH: ${{ inputs.BEC_CORE_BRANCH }} + OPHYD_DEVICES_BRANCH: ${{ inputs.OPHYD_DEVICES_BRANCH }} + PYTHON_VERSION: '3.11' + - name: Run Pytest + run: | + cd ./bec + pip install pytest pytest-random-order + pytest -v --maxfail=2 --junitxml=report.xml --random-order ./bec_server/tests ./bec_ipython_client/tests/client_tests ./bec_lib/tests + bec-e2e-test: + name: BEC End2End Tests + runs-on: ubuntu-latest + steps: + - name: Checkout BEC + uses: actions/checkout@v4 + with: + repository: bec-project/bec + ref: ${{ inputs.BEC_CORE_BRANCH }} + + - name: Run E2E Tests + uses: ./.github/actions/bec_e2e_install + with: + BEC_CORE_BRANCH: ${{ inputs.BEC_CORE_BRANCH }} + OPHYD_DEVICES_BRANCH: ${{ inputs.OPHYD_DEVICES_BRANCH }} + BEC_WIDGETS_BRANCH: ${{ inputs.BEC_WIDGETS_BRANCH }} + PYTHON_VERSION: '3.11' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afb3742..b16fb8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,14 @@ jobs: needs: [check_pr_status, formatter] if: needs.check_pr_status.outputs.branch-pr == '' uses: ./.github/workflows/pytest-matrix.yml + with: + BEC_CORE_BRANCH: ${{ inputs.BEC_CORE_BRANCH || 'main' }} + OPHYD_DEVICES_BRANCH: ${{ inputs.OPHYD_DEVICES_BRANCH || github.head_ref || github.sha}} + + child-repos: + needs: [check_pr_status, formatter] + if: needs.check_pr_status.outputs.branch-pr == '' + uses: ./.github/workflows/child_repos.yml with: BEC_CORE_BRANCH: ${{ inputs.BEC_CORE_BRANCH || 'main' }} OPHYD_DEVICES_BRANCH: ${{ inputs.OPHYD_DEVICES_BRANCH || github.head_ref || github.sha}} \ No newline at end of file