generated from esphome/esphome-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-examples.sh
More file actions
executable file
·45 lines (39 loc) · 919 Bytes
/
test-examples.sh
File metadata and controls
executable file
·45 lines (39 loc) · 919 Bytes
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
#!/bin/bash
# Run esphome config validation on all example YAML files (skipping secrets.yaml)
PASS=0
FAIL=0
FAILURES=()
for f in examples/*.yaml; do
[[ "$(basename "$f")" == "secrets.yaml" ]] && continue
echo "--- $f"
if ./esphome.sh config "$f"; then
PASS=$((PASS + 1))
else
FAIL=$((FAIL + 1))
FAILURES+=("$f")
fi
done
echo ""
echo "Config Check Results: $PASS passed, $FAIL failed"
if [ ${#FAILURES[@]} -gt 0 ]; then
echo "Failed:"
for f in "${FAILURES[@]}"; do echo " $f"; done
exit 1
fi
for f in examples/*.yaml; do
[[ "$(basename "$f")" == "secrets.yaml" ]] && continue
echo "--- $f"
if ./esphome.sh compile "$f"; then
PASS=$((PASS + 1))
else
FAIL=$((FAIL + 1))
FAILURES+=("$f")
fi
done
echo ""
echo "Full Results: $PASS passed, $FAIL failed"
if [ ${#FAILURES[@]} -gt 0 ]; then
echo "Failed:"
for f in "${FAILURES[@]}"; do echo " $f"; done
exit 1
fi