mirror of
https://github.com/OMGeeky/homecontrol.esp-sensors.git
synced 2025-12-26 17:02:29 +01:00
48 lines
1.0 KiB
YAML
48 lines
1.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
workflow_dispatch: # Allow manual triggering
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python 3.12
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Check code formatting with Black
|
|
run: |
|
|
black --check .
|
|
|
|
- name: Run test that crashes locally
|
|
run: |
|
|
python -m pytest tests/test_mqtt_client.py::TestMQTTClient::test_publish -v
|
|
|
|
- name: Run tests with pytest
|
|
run: |
|
|
python -m pytest
|
|
|
|
- name: Run tests with coverage
|
|
run: |
|
|
python -m pytest --cov=src.esp_sensors --cov-report=xml
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
fail_ci_if_error: false
|