-
Notifications
You must be signed in to change notification settings - Fork 304
129 lines (110 loc) · 3.96 KB
/
ci.yml
File metadata and controls
129 lines (110 loc) · 3.96 KB
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
name: CI
on:
push:
branches-ignore:
- gh-pages
pull_request:
branches-ignore:
- gh-pages
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install cpplint
run: pip install cpplint
- name: Run cpplint
run: make cpplint
build:
name: Build Examples
runs-on: ubuntu-latest
strategy:
matrix:
example:
- Broadcast
- CustomSettings
- DoorSensor
- GlobalInputHandler
- HookToEvents
- IteadSonoff
- IteadSonoffButton
- LedStrip
- LightOnOff
- Ping
- SingleButton
- SonoffDualShutters
- TemperatureSensor
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: |
~/.platformio
~/.cache/pip
key: ${{ runner.os }}-platformio-${{ hashFiles('**/platformio.ini') }}
restore-keys: |
${{ runner.os }}-platformio-
- name: Install PlatformIO
run: pip install -U platformio
- name: Install Arduino Core for ESP8266
run: platformio platform install espressif8266
- name: Install Arduino Core for ESP32
run: platformio platform install espressif32
- name: Install Homie library dependencies
run: |
# Install core dependencies from library.json
pio pkg install -g --library "ArduinoJson@~6.11.4"
pio pkg install -g --library "AsyncMqttClient@^0.8.0"
pio pkg install -g --library "Bounce2@^2.1.0"
# Install ESP Async WebServer from GitHub to get the correct version
# that supports both ESP8266 and ESP32 (avoids RP2040W variant)
pio pkg install -g --library "https://github.com/me-no-dev/ESPAsyncWebServer.git"
- name: Install example dependencies
continue-on-error: true
run: |
# Install optional dependencies for SonoffDualShutters example from GitHub
# These libraries are not available in the PlatformIO registry
pio pkg install -g --library "https://github.com/marvinroger/arduino-shutters.git" || true
pio pkg install -g --library "https://github.com/marvinroger/arduino-sonoff-dual.git" || true
- name: Build ${{ matrix.example }}
run: platformio ci ./examples/${{ matrix.example }} --board=esp01_1m --board=nodemcuv2 --board=esp32dev --lib="."
generate-docs:
name: Generate Documentation
runs-on: ubuntu-latest
# Only run on main/master branch, not on PRs
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install documentation dependencies
run: pip install mkdocs==1.0.4 mkdocs-material==4.6.0 pygments==2.5.2 pymdown-extensions==6.2.1 markdown==3.1.1
- name: Build documentation
run: |
chmod +x ./.circleci/assets/generate_docs.py
./.circleci/assets/generate_docs.py -o /tmp/site
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: success()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: /tmp/site
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ':package: Deploy documentation from ${{ github.sha }}'