-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (142 loc) Β· 4.8 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
name: Home Assistant CI
# yamllint disable-line rule:truthy
on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
jobs:
yamllint:
name: "π§Ή YAML Lint"
runs-on: ubuntu-latest
steps:
- name: β€΅οΈ Getting your configuration from GitHub
uses: actions/checkout@v4
- name: Running YAMLlint
uses: ibiqlik/action-yamllint@v3
continue-on-error: true
with:
config_file: .github/yamllint-config.yml
# https://github.com/ibiqlik/action-yamllint/issues/14#issuecomment-796554388
format: parsable
remarklint:
name: "π§Ή Remark Lint"
runs-on: ubuntu-latest
steps:
- name: β€΅οΈ Getting your configuration from GitHub
uses: actions/checkout@v4
- name: Running Remark lint
uses: "docker://pipelinecomponents/remark-lint:latest"
continue-on-error: true
with:
args: "remark --no-stdout --color --frail --use preset-lint-recommended ."
ha-stable-check:
name: "π‘ Home Assistant Core Stable Configuration Check"
needs: [yamllint, remarklint]
runs-on: ubuntu-latest
steps:
- name: β€΅οΈ Check out configuration from GitHub
uses: actions/checkout@v4
# Create test directory
- name: β Create test directory
run: |
mkdir -p camera
# Integrations does not exist in custom components during checkout:
- name: β Remove battery_notes integration
run: |
sed -i -e '/battery_notes\:/,+2d' configuration.yaml
- name: β Remove delete integration
run: |
sed -i -e '/delete\:/,+1d' configuration.yaml
- name: β Remove Powercalc integration
run: |
sed -i -e '/powercalc\:/,+2d' configuration.yaml
- name: β Remove Sonoff integration
run: |
sed -i -e '/sonoff\:/,+3d' configuration.yaml
- name: π Run Home Assistant Configuration Check
uses: frenck/action-home-assistant@v1
with:
path: "./"
secrets: ./secrets.yaml.sample
version: "stable"
ha-future-checks:
name: "π’ Home Assistant Core ${{ matrix.version }} Configuration Check"
needs: [yamllint, remarklint]
runs-on: ubuntu-latest
strategy:
matrix:
version: ["beta", "dev"]
steps:
- name: β€΅οΈ Check out configuration from GitHub
uses: actions/checkout@v4
# Create test directory
- name: β Create test directory
run: |
mkdir -p camera
# Integrations does not exist in custom components during checkout:
- name: β Remove battery_notes integration
run: |
sed -i -e '/battery_notes\:/,+2d' configuration.yaml
- name: β Remove delete integration
run: |
sed -i -e '/delete\:/,+1d' configuration.yaml
- name: β Remove Powercalc integration
run: |
sed -i -e '/powercalc\:/,+2d' configuration.yaml
- name: β Remove Sonoff integration
run: |
sed -i -e '/sonoff\:/,+3d' configuration.yaml
- name: π Run Home Assistant Configuration Check
uses: frenck/action-home-assistant@v1
continue-on-error: true
with:
path: "./"
secrets: ./secrets.yaml.sample
version: "${{ matrix.version }}"
deploy:
name: "π Deploy changes"
needs: [ha-stable-check]
runs-on: ubuntu-latest
steps:
- name: π Tailscale
uses: tailscale/github-action@v2
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
version: 1.58.2
- name: π Deploying
uses: Wandalen/wretry.action@v2.1.0
with:
action: fjogeleit/http-request-action@master
with: |
url: '${{ secrets.DEPLOYMENT_URL }}'
method: POST
customHeaders: '{"Content-Type":"application/json"}'
data: '{ "key_token":"${{ secrets.PULL_KEY }}" }'
attempt_limit: 3
attempt_delay: 2000
esphome:
name: "π οΈ ESPHome check"
runs-on: ubuntu-latest
needs: [yamllint]
steps:
- name: β€΅οΈ Check out configuration from GitHub
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install esphome
pip list
esphome version
- name: βοΈ Copy stub files into configuration folder
run: cp -R ./esphome/secrets.yaml.sample ./esphome/secrets.yaml
- name: π Run esphome on all files
continue-on-error: true
run: |
for file in $(find ./esphome -type f -name "*.yaml" -not -name "secrets.yaml"); do esphome "${file}" config; done