more #2499
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | | |
| make fast-test | |
| make slow-test | |
| make flakey-test |