-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (51 loc) · 1.9 KB
/
Copy pathci.yaml
File metadata and controls
59 lines (51 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI
on:
push:
pull_request:
jobs:
build:
name: Test & Lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f unittests/requirements.txt ]; then pip install -r unittests/requirements.txt; fi
# tzdata only — bosch-thermostat-client is pinned in
# unittests/requirements.txt to match manifest.json (==0.28.2).
# Installing it unpinned here would silently upgrade past that pin.
pip install tzdata
- name: Lint with Ruff
run: |
# Check for syntax errors or bad style
ruff check --exclude deric-bosch-client --exclude unittests --exclude test_pointtapi_oauth.py --exclude test_pointtapi_playwright.py .
- name: Run Tests
run: |
# pipefail is NOT on by default in Actions' `bash -e {0}`, and without
# it `tee` would swallow pytest's exit code — including the
# --cov-fail-under gate, which would then never fail the build.
set -o pipefail
python3 -m pytest --tb=short -q unittests --override-ini="asyncio_mode=auto" \
--cov=custom_components/bosch --cov-report=term --cov-fail-under=70 \
| tee pytest.log
- name: Coverage summary
if: always()
run: |
{
echo '### Coverage'
echo
echo '```'
sed -n '/^Name /,/^TOTAL/p' pytest.log
echo '```'
} >> "$GITHUB_STEP_SUMMARY"