-
Notifications
You must be signed in to change notification settings - Fork 16
171 lines (144 loc) · 5.02 KB
/
ci.yaml
File metadata and controls
171 lines (144 loc) · 5.02 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
name: CI
on: [pull_request, push, workflow_dispatch]
jobs:
test:
runs-on: ${{ matrix.os }}
env:
TESTING: 1
DOT_PIOREACTOR: ${{ github.workspace }}/.pioreactor
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
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.13"]
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- 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 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"
curl https://raw.githubusercontent.com/Pioreactor/list-of-plugins/refs/heads/main/plugins.json > $DOT_PIOREACTOR/plugins/api_plugins_allowlist.json
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 tests
run: |
export PLUGINS_DEV="${PLUGINS_DEV:-$GITHUB_WORKSPACE/plugins_dev}"
echo "Running fast test"
make fast-test
echo "Running slow test"
make slow-test
echo "Running flakey test"
make flakey-test || true