-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (66 loc) · 2.02 KB
/
main.yml
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
---
name: Check HA config
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- live
paths:
- '**.yaml'
- '**.yml'
- 'esphome/**/*.h'
jobs:
yamllint:
name: 🧹 Lint YAML files
runs-on: ubuntu-latest
steps:
- id: checkout
name: ⤵️ Check out configuration from GitHub
uses: actions/checkout@v3
- id: yaml-lint
name: 🚀 Run yamllint
uses: ibiqlik/action-yamllint@v3
- run: echo ${{ steps.yaml-lint.outputs.logfile }}
- id: upload
name: ⤴️ Upload results
uses: actions/upload-artifact@v2
if: always()
with:
name: yamllint-logfile
path: ${{ steps.yaml-lint.outputs.logfile }}
home-assistant:
name: 🏠 Home Assistant configuration check
needs: [yamllint]
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out configuration from GitHub
uses: actions/checkout@v3
- name: 🚀 Run Home Assistant configuration check
uses: frenck/action-home-assistant@v1
with:
path: "./"
secrets: secrets.yaml.tmpl
esphome:
name: 🏘️ ESPHome configuration check
runs-on: ubuntu-latest
needs: [yamllint]
steps:
- name: ⤵️ Check out configuration from GitHub
uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install esphome
pip list
esphome version
- name: Copy secrets.yaml.tmpl into place for secrets.yaml
run: cp secrets.yaml.tmpl secrets.yaml
working-directory: "./esphome"
- name: 🚀 Run ESPHome config check 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