-
Notifications
You must be signed in to change notification settings - Fork 17
265 lines (233 loc) · 7.99 KB
/
Copy pathci.yaml
File metadata and controls
265 lines (233 loc) · 7.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
name: CI
on: [pull_request, push, workflow_dispatch]
jobs:
frontend-test:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: "25"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Run frontend tests
run: |
make frontend-test
backend-test:
runs-on: ubuntu-latest
env:
TESTING: 1
DOT_PIOREACTOR: ${{ github.workspace }}/.pioreactor
GLOBAL_CONFIG: ${{ github.workspace }}/.pioreactor/config.ini
RUN_PIOREACTOR: ${{ github.workspace }}/run/pioreactor
LG_WD: ${{ github.workspace }}/run/pioreactor
TMPDIR: /tmp/
PIO_VENV: ${{ github.workspace }}/.venv
VIRTUAL_ENV: ${{ github.workspace }}/.venv
PIO_EXECUTABLE: ${{ github.workspace }}/.venv/bin/pio
PIOS_EXECUTABLE: ${{ github.workspace }}/.venv/bin/pios
PLUGINS_DEV: ${{ github.workspace }}/plugins_dev
HARDWARE: 1.2
FIRMWARE: 0.5
BLINKA_FORCECHIP: BCM2XXX
BLINKA_FORCEBOARD: RASPBERRY_PI_3A_PLUS
MODEL_NAME: pioreactor_40ml
MODEL_VERSION: 1.5
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install python libraries into env
run: |
# env create in make install
make install
wget https://github.com/Gadgetoid/PY_LGPIO/releases/download/0.2.2.0/lgpio-0.2.2.0.tar.gz -O lgpio-0.2.2.0.tar.gz
tar -xvzf lgpio-0.2.2.0.tar.gz
# Install lgpio into the venv created by `make install`.
# Note: keep working directory at repo root so `.venv` is resolvable.
.venv/bin/python -m pip install -e ./lgpio-0.2.2.0
.venv/bin/pip list
- name: Mosquitto MQTT Broker in GitHub Actions
uses: Namoshek/mosquitto-github-action@v1
with:
version: '1.6'
- name: Install any other required linux software
run: |
sudo apt-get update
sudo apt-get install avahi-daemon avahi-discover avahi-utils mosquitto-clients
- name: Create pioreactor folders
run: |
mkdir -p "$RUN_PIOREACTOR"
mkdir -p "$RUN_PIOREACTOR/cache"
touch "$RUN_PIOREACTOR/cache/huey.db"
mkdir -p "$DOT_PIOREACTOR"
mv config.dev.ini "$DOT_PIOREACTOR"/config.ini
mkdir -p "$DOT_PIOREACTOR"/storage
mkdir -p "$DOT_PIOREACTOR"/hardware/hats/1.2
mkdir -p "$DOT_PIOREACTOR"/hardware/models/pioreactor_40ml/1.5
cat <<'EOF_HW' > "$DOT_PIOREACTOR"/hardware/hats/1.2/pwm.yaml
heater_pwm_channel: "5"
pwm_to_pin:
"1": 17
"2": 13
"3": 16
"4": 12
"5": 18
EOF_HW
cat <<'EOF_HW' > "$DOT_PIOREACTOR"/hardware/hats/1.2/dac.yaml
address: 0x2C
EOF_HW
cat <<'EOF_HW' > "$DOT_PIOREACTOR"/hardware/hats/1.2/temp.yaml
address: 0x4F
EOF_HW
cat <<'EOF_HW' > "$DOT_PIOREACTOR"/hardware/hats/1.2/adc.yaml
aux:
driver: pico
address: 0x2C
channel: 1
version:
driver: pico
address: 0x2C
channel: 0
pd1:
driver: pico
address: 0x2C
channel: 2
pd2:
driver: pico
address: 0x2C
channel: 3
EOF_HW
cat <<'EOF_HW' > "$DOT_PIOREACTOR"/hardware/hats/1.2/gpio.yaml
pcb_led_pin: 23
pcb_button_pin: 4
hall_sensor_pin: 21
sda_pin: 2
scl_pin: 3
EOF_HW
cat <<'EOF_HW' > "$DOT_PIOREACTOR"/hardware/models/pioreactor_40ml/1.5/adc.yaml
pd1:
driver: ads1114
address: 0x48
channel: 0
pd2:
driver: ads1114
address: 0x49
channel: 0
EOF_HW
mkdir -p "$DOT_PIOREACTOR/plugins"
mkdir -p "$DOT_PIOREACTOR/ui/jobs"
mkdir -p "$DOT_PIOREACTOR/ui/automations/dosing"
mkdir -p "$DOT_PIOREACTOR/plugins/ui/jobs"
mkdir -p "$DOT_PIOREACTOR/plugins/ui/automations/dosing"
cat <<'EOF_UI' > "$DOT_PIOREACTOR"/ui/jobs/00_stirring.yaml
---
display_name: Stirring
job_name: stirring
display: true
source: app
description: Start the stirring on the Pioreactor.
published_settings:
- key: target_rpm
unit: RPM
label: Target stir RPM
description: Modify the target RPM of stirring.
type: numeric
display: true
EOF_UI
cat <<'EOF_UI' > "$DOT_PIOREACTOR"/ui/jobs/50_self_test.yaml
---
display_name: Self test
job_name: self_test
display: true
source: app
description: Run the hardware and software self test suite.
published_settings: []
EOF_UI
cat <<'EOF_UI' > "$DOT_PIOREACTOR"/ui/automations/dosing/chemostat.yaml
---
display_name: Chemostat
automation_name: chemostat
description: Add and remove a constant volume of media on a fixed schedule.
fields:
- key: duration
default: 20
unit: min
label: Time between dosing
type: numeric
- key: exchange_volume_ml
default: 0.5
unit: mL
label: Exchange volume
type: numeric
EOF_UI
cat <<'EOF_UI' > "$DOT_PIOREACTOR"/ui/automations/dosing/turbidostat.yaml
---
display_name: Turbidostat
automation_name: turbidostat
description: Keep the culture near a target biomass by exchanging media.
fields:
- key: target_normalized_od
default: 1.0
unit: AU
label: Target normalized OD
type: numeric
EOF_UI
cat <<'EOF_UI' > "$DOT_PIOREACTOR"/plugins/ui/jobs/90_example_plugin.yaml
---
display_name: Example plugin
job_name: example_plugin
display: true
source: my-example-plugin
description: Example plugin job descriptor for CI.
published_settings: []
EOF_UI
cat <<'EOF_UI' > "$DOT_PIOREACTOR"/plugins/ui/automations/dosing/90_example_plugin_automation.yaml
---
display_name: Example plugin automation
automation_name: example_plugin_automation
source: my-example-plugin
description: Example plugin automation descriptor for CI.
fields:
- key: target
default: 0.5
unit: AU
label: Target
type: numeric
EOF_UI
ls "$DOT_PIOREACTOR"
make check-env
- name: Create plugin folder and seed it
run: |
mkdir -p "$PLUGINS_DEV"
cat <<'EOF_PLUGIN' > "$PLUGINS_DEV"/example_plugin.py
import click
from pioreactor.background_jobs.base import BackgroundJob
__plugin_version__ = "0.2.0"
__plugin_name__ = "my-example-plugin"
class ExamplePlugin(BackgroundJob):
job_name = "example_plugin"
def __init__(self):
super().__init__(unit="test", experiment="test")
@click.command(name="example_plugin")
def click_example_plugin():
job = ExamplePlugin()
EOF_PLUGIN
- name: Start web API
run: |
make web-dev &
sleep 5
- name: Run fast tests
run: |
make fast-test
- name: Run slow tests
run: |
make slow-test
- name: Run flakey tests
run: |
make flakey-test || true