Skip to content

Commit 65551f3

Browse files
wakonigcappel89
authored andcommitted
feat: add gitea ci template
1 parent 954f8ac commit 65551f3

1 file changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI for {{ project_name }}
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
inputs:
7+
BEC_WIDGETS_BRANCH:
8+
description: "Branch of BEC Widgets to install"
9+
required: false
10+
type: string
11+
default: "main"
12+
BEC_CORE_BRANCH:
13+
description: "Branch of BEC Core to install"
14+
required: false
15+
type: string
16+
default: "main"
17+
OPHYD_DEVICES_BRANCH:
18+
description: "Branch of Ophyd Devices to install"
19+
required: false
20+
type: string
21+
default: "main"
22+
BEC_PLUGIN_REPO_BRANCH:
23+
description: "Branch of the BEC Plugin Repository to install"
24+
required: false
25+
type: string
26+
default: "main"
27+
PYTHON_VERSION:
28+
description: "Python version to use"
29+
required: false
30+
type: string
31+
default: "3.11"
32+
33+
permissions:
34+
pull-requests: write
35+
36+
jobs:
37+
test:
38+
runs-on: ubuntu-latest
39+
env:
40+
QTWEBENGINE_DISABLE_SANDBOX: 1
41+
QT_QPA_PLATFORM: "offscreen"
42+
43+
steps:
44+
- name: Setup Python
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: ${{ inputs.PYTHON_VERSION || '3.11' }}
48+
49+
- name: Checkout BEC Core
50+
uses: actions/checkout@v4
51+
with:
52+
repository: bec/bec
53+
ref: ${{ inputs.BEC_CORE_BRANCH || 'main' }}
54+
path: ./bec
55+
56+
- name: Checkout Ophyd Devices
57+
uses: actions/checkout@v4
58+
with:
59+
repository: bec/ophyd_devices
60+
ref: ${{ inputs.OPHYD_DEVICES_BRANCH || 'main' }}
61+
path: ./ophyd_devices
62+
63+
- name: Checkout BEC Widgets
64+
uses: actions/checkout@v4
65+
with:
66+
repository: bec/bec_widgets
67+
ref: ${{ inputs.BEC_WIDGETS_BRANCH || 'main' }}
68+
path: ./bec_widgets
69+
70+
- name: Checkout BEC Plugin Repository
71+
uses: actions/checkout@v4
72+
with:
73+
repository: bec/{{ project_name }}
74+
ref: ${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}
75+
path: ./{{ project_name }}
76+
77+
- name: Install dependencies
78+
shell: bash
79+
run: |
80+
sudo apt-get update
81+
sudo apt-get install -y libgl1 libegl1 x11-utils libxkbcommon-x11-0 libdbus-1-3 xvfb
82+
sudo apt-get -y install libnss3 libxdamage1 libasound2t64 libatomic1 libxcursor1
83+
84+
- name: Install Python dependencies
85+
shell: bash
86+
run: |
87+
pip install uv
88+
uv pip install --system -e ./ophyd_devices
89+
uv pip install --system -e ./bec/bec_lib[dev]
90+
uv pip install --system -e ./bec/bec_ipython_client
91+
uv pip install --system -e ./bec/bec_server[dev]
92+
uv pip install --system -e ./bec_widgets[dev,pyside6]
93+
uv pip install --system -e ./{{ project_name }}
94+
95+
- name: Run Pytest with Coverage
96+
id: coverage
97+
run: pytest --random-order --cov=./{{ project_name }} --cov-config=./{{ project_name }}/pyproject.toml --cov-branch --cov-report=xml --no-cov-on-fail ./{{ project_name }}/tests/

0 commit comments

Comments
 (0)