-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (99 loc) · 3.49 KB
/
home-assistant.yaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
# Source: https://github.com/frenck/action-home-assistant
# Examples: https://github.com/frenck/home-assistant-config/blob/master/.github/workflows/home-assistant.yml
# https://github.com/metbril/home-assistant-config/blob/main/.github/workflows/ha-config-check.yml
#
name: Home Assistant CI
# yamllint disable-line rule:truthy
on:
push:
pull_request:
schedule:
- cron: 0 12 * * 4
jobs:
yamllint:
name: 🧹 YAML Lint
runs-on: ubuntu-latest
steps:
- name: 📥 Check out repository
uses: actions/[email protected]
- name: 🚀 Run YAMLlint
uses: frenck/[email protected]
remarklint:
name: 🧹 Remark Lint
runs-on: ubuntu-latest
steps:
- name: 📥 Check out repository
uses: actions/[email protected]
- name: 🚀 Run Remark lint
uses: "docker://pipelinecomponents/remark-lint:latest"
continue-on-error: true
with:
args: "remark --no-stdout --color --frail --use preset-lint-recommended ."
ha_version:
name: "🏠 Get HA Version"
runs-on: ubuntu-latest
outputs:
current_version: ${{ steps.currentver.outputs.current_version }}
steps:
- name: 📥 Check out repository
uses: actions/[email protected]
- name: 🚀 Get Installed Version from .HA_VERSION
id: currentver
run: |
HA_VERSION=$(<.HA_VERSION)
echo $HA_VERSION
echo "current_version=$HA_VERSION" >> $GITHUB_OUTPUT
home-assistant:
name: "🏠 HA Core ${{ matrix.version }} Check"
needs: [yamllint, ha_version]
runs-on: ubuntu-latest
strategy:
matrix:
version: ["${{ needs.ha_version.outputs.current_version }}", "stable", "beta", "dev"]
steps:
- name: 📥 Check out repository
uses: actions/[email protected]
- name: 📄 Create empty files
run: |
touch ./home-assistant_v2.db
touch ./home-assistant.log
- name: 📁 Create custom_components folder
run: |
mkdir -p ./custom_components
# Check out custom components that require YAML configuration.
# yamllint disable rule:line-length
- name: 📥 Clone custom component (Dreamscreen)
run: |
git clone https://github.com/J3n50m4t/Home-Assistant-DreamScreen-Service.git
mv -v Home-Assistant-DreamScreen-Service/custom_components/* ./custom_components
# yamllint enable rule:line-length
- name: 🚀 Run Home Assistant Configuration Check
uses: frenck/[email protected]
with:
path: "."
secrets: ./.stubs/secrets.yaml
version: "${{ matrix.version }}"
esphome:
name: "🛠️ ESPHome Check"
runs-on: ubuntu-latest
needs: [yamllint]
steps:
- name: 📥 Check out repository
uses: actions/[email protected]
- name: 📜 Use Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: 🔗 Install dependencies
run: |
python -m pip install --upgrade pip pillow setuptools wheel
pip install esphome
pip list
esphome version
- name: 📄 Copy secrets stub into configuration folder
run: cp ./.stubs/espsecrets.yaml ./esphome/secrets.yaml
- name: 🚀 Run ESPHome on all files
# yamllint disable rule:line-length
run: |
for file in $(find ./esphome -type f -name "*.yaml" -maxdepth 1 -not -name "secrets.yaml"); do esphome config "${file}"; done