Skip to content

Commit 05019f2

Browse files
committed
Add GitHub Actions workflow for Rinnai Custom Component CI
1 parent 7b871a1 commit 05019f2

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Rinnai Custom Component CI
2+
3+
on:
4+
push:
5+
branches: [ dev, master ]
6+
pull_request:
7+
branches: [ dev, master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-component:
12+
runs-on: ubuntu-latest
13+
# Target only Python 3.11, as required by Home Assistant 2025.11.0
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python 3.11
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.11'
22+
23+
- name: Cache pip
24+
uses: actions/cache@v3
25+
with:
26+
path: ~/.cache/pip
27+
key: ${{ runner.os }}-pip-${{ hashFiles('**/manifest.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-pip-
30+
31+
- name: Install Home Assistant
32+
run: |
33+
pip install --upgrade pip
34+
pip install homeassistant
35+
36+
- name: Prepare Home Assistant config
37+
run: |
38+
mkdir -p ./config/custom_components
39+
cp -r custom_components/rinnaicontrolr-ha ./config/custom_components/rinnai
40+
41+
# Install custom component requirements from manifest.json
42+
- name: Install custom component requirements
43+
run: |
44+
python -c "import json; f=open('custom_components/rinnaicontrolr-ha/manifest.json'); reqs=json.load(f).get('requirements', []); print('Installing:', reqs); import subprocess; [subprocess.check_call(['pip', 'install', r]) for r in reqs]"
45+
46+
- name: Start Home Assistant
47+
run: |
48+
nohup hass --config ./config &
49+
sleep 60
50+
51+
- name: Check Home Assistant log for errors
52+
run: |
53+
if grep -i 'error' ./config/home-assistant.log; then
54+
echo "Errors found in Home Assistant log!"
55+
exit 1
56+
else
57+
echo "No errors found in Home Assistant log."
58+
fi

0 commit comments

Comments
 (0)