Skip to content

feat: Add CI/CD pipeline and test suite for Farcom Enviro+ app (#7) #1

feat: Add CI/CD pipeline and test suite for Farcom Enviro+ app (#7)

feat: Add CI/CD pipeline and test suite for Farcom Enviro+ app (#7) #1

Workflow file for this run

name: Farcom Enviro+ CI
# CI for the Farcom Industrial application code (examples/farcom-mqtt-enviro.py
# and its test suite). The upstream Pimoroni library has its own workflow in
# test.yml; this pipeline is scoped to the Farcom app so the two never collide.
on:
push:
branches:
- master
- 'claude/**'
paths:
- 'examples/farcom-mqtt-enviro.py'
- 'tests/**'
- '.github/workflows/farcom-ci.yml'
- 'pyproject.toml'
pull_request:
paths:
- 'examples/farcom-mqtt-enviro.py'
- 'tests/**'
- '.github/workflows/farcom-ci.yml'
- 'pyproject.toml'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Ruff
run: python -m pip install --upgrade ruff
- name: Ruff lint (tests)
run: ruff check tests/
- name: Syntax check production script
run: python -m py_compile examples/farcom-mqtt-enviro.py
test:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python: ['3.9', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install test dependencies
run: python -m pip install --upgrade pytest
- name: Run Farcom test suite
run: pytest tests/ -v