| 1 |
name: CI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
pull_request: ~ |
| 6 |
|
| 7 |
jobs: |
| 8 |
ci: |
| 9 |
name: Run CI |
| 10 |
runs-on: ubuntu-latest |
| 11 |
steps: |
| 12 |
- name: Check out code from GitHub |
| 13 |
uses: actions/checkout@v4 |
| 14 |
|
| 15 |
- name: Install uv |
| 16 |
uses: astral-sh/setup-uv@v5 |
| 17 |
|
| 18 |
- name: Set up Python |
| 19 |
uses: actions/setup-python@v5 |
| 20 |
id: python |
| 21 |
with: |
| 22 |
python-version-file: pyproject.toml |
| 23 |
|
| 24 |
- name: Register Python problem matcher |
| 25 |
run: | |
| 26 |
echo "::add-matcher::.github/workflows/matchers/python.json" |
| 27 |
|
| 28 |
- name: Run pre-commit |
| 29 |
run: | |
| 30 |
uv venv venv |
| 31 |
. venv/bin/activate |
| 32 |
|
| 33 |
uv pip install -e '.[testing]' |
| 34 |
uv pip install pre-commit pytest-github-actions-annotate-failures |
| 35 |
|
| 36 |
pre-commit install-hooks |
| 37 |
pre-commit run --show-diff-on-failure --color=always --all-files |
| 38 |
|
| 39 |
- name: Run pytest |
| 40 |
run: | |
| 41 |
. venv/bin/activate |
| 42 |
pytest \ |
| 43 |
-n auto \ |
| 44 |
-qq \ |
| 45 |
--timeout=20 \ |
| 46 |
--durations=10 \ |
| 47 |
--cov ha_silabs_firmware_client \ |
| 48 |
--cov-config pyproject.toml \ |
| 49 |
-o console_output_style=count \ |
| 50 |
-p no:sugar \ |
| 51 |
tests |
| 52 |
|
| 53 |
coverage report --fail-under=100 |