feat: add System Monitor sensor plugin for hardware telemetry #33
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: Run Integration Tests | |
| env: | |
| OM1_API_KEY: ${{ secrets.OM1_API_KEY }} | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' # Every hour UTC | |
| workflow_dispatch: # Allow manual trigger via GitHub UI | |
| push: | |
| branches: | |
| - 'main' | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: 'recursive' | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y portaudio19-dev python3-pyaudio cmake | |
| - name: Cache CycloneDDS build | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/cyclonedds/cyclonedds/install | |
| key: ${{ runner.os }}-cyclonedds-0.10.x-${{ hashFiles('.github/workflows/integration-test.yml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cyclonedds-0.10.x- | |
| - name: Install cycloneDDS | |
| run: | | |
| if [ ! -d "/tmp/cyclonedds/cyclonedds/install" ]; then | |
| echo "Building CycloneDDS from source..." | |
| mkdir -p /tmp/cyclonedds | |
| cd /tmp/cyclonedds | |
| git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x | |
| cd cyclonedds && mkdir build install && cd build | |
| cmake .. -DCMAKE_INSTALL_PREFIX=../install -DBUILD_EXAMPLES=ON | |
| cmake --build . --target install | |
| else | |
| echo "Using cached CycloneDDS installation" | |
| fi | |
| echo "CYCLONEDDS_HOME=/tmp/cyclonedds/cyclonedds/install" >> $GITHUB_ENV | |
| echo "/tmp/cyclonedds/cyclonedds/install/lib" >> $GITHUB_PATH | |
| echo "CMAKE_PREFIX_PATH=/tmp/cyclonedds/cyclonedds/install" >> $GITHUB_ENV | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Cache uv dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/uv | |
| .venv | |
| key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml', 'uv.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-uv- | |
| - name: Install dependencies | |
| run: | | |
| uv sync --extra dds | |
| - name: Run integration tests | |
| run: | | |
| uv run pytest -m "integration" --log-cli-level=DEBUG --junitxml=test-reports/results.xml -s | |
| - name: Extract test summary | |
| id: summary | |
| run: | | |
| TOTAL=$(grep -oP 'tests="\K[0-9]+' test-reports/results.xml) | |
| FAILURES=$(grep -oP 'failures="\K[0-9]+' test-reports/results.xml) | |
| ERRORS=$(grep -oP 'errors="\K[0-9]+' test-reports/results.xml) | |
| echo "total=$TOTAL" >> $GITHUB_OUTPUT | |
| echo "failures=$FAILURES" >> $GITHUB_OUTPUT | |
| echo "errors=$ERRORS" >> $GITHUB_OUTPUT | |
| - name: Notify Slack on failure | |
| if: failure() && github.event_name == 'schedule' | |
| run: | | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data "{ | |
| \"text\": \"❌ @channel *Integration Tests Failed*\n\ | |
| *Repository:* \`${{ github.repository }}\`\n\ | |
| *Branch:* \`${{ github.ref_name }}\`\n\ | |
| *Total:* ${{ steps.summary.outputs.total }} • *Failures:* ${{ steps.summary.outputs.failures }} • *Errors:* ${{ steps.summary.outputs.errors }}\n\ | |
| 🔗 <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow Run>\" | |
| }" \ | |
| ${{ secrets.ONCALL_SLACK_WEBHOOK_URL }} | |
| - name: Notify Slack on success | |
| if: success() && github.event_name == 'schedule' | |
| run: | | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data "{ | |
| \"text\": \"✅ *All Integration Tests Passed*\n\ | |
| *Total:* ${{ steps.summary.outputs.total }}\n\ | |
| 🔗 <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>\" | |
| }" \ | |
| ${{ secrets.ONCALL_SLACK_WEBHOOK_URL }} |