Skip to content

Commit d1685ea

Browse files
pidgeclaude
andcommitted
Add sketch profiles and update CI to use them
Add sketch.yaml files to both sketches defining build profiles for: - Arduino Uno (AVR) - ESP8266 (NodeMCU v2) - ESP32 Update CI workflow to use profile-based compilation instead of manual platform/library installation. This provides: - Isolated, reproducible builds - Auto-download of dependencies - Consistent behavior between local dev and CI - Simplified CI configuration Each profile specifies: - FQBN (Fully Qualified Board Name) - Platform version - IRremote library version (4.4.1) - Platform index URLs for ESP boards 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 6d13be7 commit d1685ea

File tree

3 files changed

+53
-30
lines changed

3 files changed

+53
-30
lines changed

.github/workflows/arduino-build.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,14 @@ jobs:
1313
strategy:
1414
matrix:
1515
sketch:
16-
- ac_control/ir_sender/ir_sender.ino
17-
- ac_control/ir_receiver/ir_receiver.ino
18-
board:
19-
- fqbn: "arduino:avr:uno"
20-
platform: "arduino:avr"
21-
name: "Arduino Uno"
22-
- fqbn: "esp8266:esp8266:nodemcuv2"
23-
platform: "esp8266:esp8266"
24-
platform-url: "https://arduino.esp8266.com/stable/package_esp8266com_index.json"
25-
name: "ESP8266"
26-
- fqbn: "esp32:esp32:esp32"
27-
platform: "esp32:esp32"
28-
platform-url: "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
29-
name: "ESP32"
16+
- path: ac_control/ir_sender
17+
name: ir_sender
18+
- path: ac_control/ir_receiver
19+
name: ir_receiver
20+
profile:
21+
- uno
22+
- esp8266
23+
- esp32
3024

3125
steps:
3226
- name: Checkout repository
@@ -35,23 +29,10 @@ jobs:
3529
- name: Setup Arduino CLI
3630
uses: arduino/setup-arduino-cli@v1
3731

38-
- name: Install Arduino platform
32+
- name: Compile sketch with profile ${{ matrix.profile }}
3933
run: |
40-
if [ -n "${{ matrix.board.platform-url }}" ]; then
41-
arduino-cli config init
42-
arduino-cli config add board_manager.additional_urls ${{ matrix.board.platform-url }}
43-
fi
44-
arduino-cli core update-index
45-
arduino-cli core install ${{ matrix.board.platform }}
46-
47-
- name: Install IRremote library
48-
run: |
49-
arduino-cli lib install "[email protected]"
50-
51-
- name: Compile sketch for ${{ matrix.board.name }}
52-
run: |
53-
arduino-cli compile --fqbn ${{ matrix.board.fqbn }} ${{ matrix.sketch }}
34+
arduino-cli compile --profile ${{ matrix.profile }} ${{ matrix.sketch.path }}
5435
5536
- name: Build summary
5637
run: |
57-
echo "✅ Successfully built ${{ matrix.sketch }} for ${{ matrix.board.name }}"
38+
echo "✅ Successfully built ${{ matrix.sketch.name }} for profile ${{ matrix.profile }}"

ac_control/ir_receiver/sketch.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
profiles:
2+
uno:
3+
fqbn: arduino:avr:uno
4+
platforms:
5+
- platform: arduino:avr (1.8.6)
6+
libraries:
7+
- IRremote (4.4.1)
8+
esp8266:
9+
fqbn: esp8266:esp8266:nodemcuv2
10+
platforms:
11+
- platform: esp8266:esp8266 (3.1.2)
12+
platform_index_url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
13+
libraries:
14+
- IRremote (4.4.1)
15+
esp32:
16+
fqbn: esp32:esp32:esp32
17+
platforms:
18+
- platform: esp32:esp32 (3.3.2)
19+
platform_index_url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
20+
libraries:
21+
- IRremote (4.4.1)

ac_control/ir_sender/sketch.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
profiles:
2+
uno:
3+
fqbn: arduino:avr:uno
4+
platforms:
5+
- platform: arduino:avr (1.8.6)
6+
libraries:
7+
- IRremote (4.4.1)
8+
esp8266:
9+
fqbn: esp8266:esp8266:nodemcuv2
10+
platforms:
11+
- platform: esp8266:esp8266 (3.1.2)
12+
platform_index_url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
13+
libraries:
14+
- IRremote (4.4.1)
15+
esp32:
16+
fqbn: esp32:esp32:esp32
17+
platforms:
18+
- platform: esp32:esp32 (3.3.2)
19+
platform_index_url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
20+
libraries:
21+
- IRremote (4.4.1)

0 commit comments

Comments
 (0)