-
-
Notifications
You must be signed in to change notification settings - Fork 9
72 lines (67 loc) · 2.11 KB
/
ci.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
---
name: CI
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
schedule:
- cron: 0 10 * * *
concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
yamllint:
name: 🧹 yamllint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out configuration from GitHub
uses: actions/[email protected]
- name: 🚀 Run yamllint
uses: frenck/[email protected]
prepare:
runs-on: ubuntu-latest
needs:
- yamllint
outputs:
files: ${{ steps.files-array.outputs.files }}
steps:
- name: ⤵️ Check out configuration from GitHub
uses: actions/[email protected]
- name: Build files array
id: files-array
# yamllint disable rule:line-length
run: |-
files=$(find . -maxdepth 1 -type f -name "*.yaml" -not -name "secrets.yaml" -not -name "secrets.ci.yaml" | jq -Rcns 'inputs | . / "\n" | map(select(length > 0) | sub("./";"")) ')
echo files=$files >> $GITHUB_OUTPUT
# yamllint enable rule:line-length
configs:
runs-on: ubuntu-latest
name: "Validate ESPHome config: ${{ matrix.file }}"
needs:
- yamllint
- prepare
strategy:
matrix:
file: ${{ fromJson(needs.prepare.outputs.files) }}
fail-fast: false
steps:
- name: ⤵️ Check out configuration from GitHub
uses: actions/[email protected]
- name: Set up Python 3.9
uses: actions/[email protected]
with:
python-version: 3.9
- name: Install ESPHome
run: pip install git+https://github.com/esphome/esphome.git@dev
- name: Rename stub secrets
run: mv ./secrets.ci.yaml ./secrets.yaml
- name: Install extra requirements
run: |-
if [ -f .github/workflows/requirements/${{matrix.file}}.txt ]; then
pip install -r .github/workflows/requirements/${{matrix.file}}.txt
fi
- name: Run ESPHome config
run: esphome config ${{ matrix.file }}