Skip to content

Commit fda793f

Browse files
authored
Merge pull request #79 from SenaxInc/copilot/add-112025-to-ci-test
Add TankAlarm-112025 projects to Arduino CI workflow
2 parents b1da2b0 + 60627fb commit fda793f

File tree

2 files changed

+114
-37
lines changed

2 files changed

+114
-37
lines changed

.github/workflows/README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ This directory contains automated CI/CD workflows for the ArduinoSMSTankAlarm pr
77
**File:** `arduino-ci.yml`
88

99
### Purpose
10-
Automatically compiles the Arduino code for the TankAlarm-092025 projects
11-
(both Client and Server) to ensure code quality and catch compilation errors early.
10+
Automatically compiles the Arduino code for both TankAlarm-092025 and TankAlarm-112025 projects
11+
to ensure code quality and catch compilation errors early.
1212

1313
### Triggers
1414
The workflow runs on:
1515
- **Push events** to `main` or `master` branches when changes are made to:
1616
- `TankAlarm-092025-Client-Hologram/` directory
1717
- `TankAlarm-092025-Server-Hologram/` directory
18+
- `TankAlarm-112025-Client-BluesOpta/` directory
19+
- `TankAlarm-112025-Server-BluesOpta/` directory
20+
- `TankAlarm-112025-Viewer-BluesOpta/` directory
1821
- The workflow file itself
1922
- **Pull requests** targeting `main` or `master` branches
2023
- **Manual trigger** via workflow_dispatch
@@ -25,21 +28,32 @@ The workflow runs on:
2528
- Checks out the repository code
2629
- Installs Arduino CLI
2730
- Installs Arduino SAMD core for MKR boards
31+
- Installs Arduino Mbed OS Opta Boards core for Arduino Opta
2832

2933
2. **Installs required libraries**
3034
- MKRNB (cellular connectivity)
3135
- SD (SD card operations)
3236
- ArduinoLowPower (power management)
3337
- RTCZero (real-time clock)
3438
- Ethernet (network connectivity for server)
39+
- ArduinoJson (JSON parsing for configuration)
40+
- Blues Wireless Notecard (cellular connectivity via Blues)
3541

3642
3. **Compiles the sketches**
43+
44+
**TankAlarm-092025 (Arduino MKR NB 1500):**
3745
- Compiles `TankAlarm-092025-Client-Hologram.ino`
3846
- Compiles `TankAlarm-092025-Server-Hologram.ino`
3947
- Target board: Arduino MKR NB 1500 (`arduino:samd:mkrnb1500`)
48+
49+
**TankAlarm-112025 (Arduino Opta):**
50+
- Compiles `TankAlarm-112025-Client-BluesOpta.ino`
51+
- Compiles `TankAlarm-112025-Server-BluesOpta.ino`
52+
- Compiles `TankAlarm-112025-Viewer-BluesOpta.ino`
53+
- Target board: Arduino Opta (`arduino:mbed_opta:opta`)
4054

4155
4. **Handles compilation failures**
42-
- If either compilation fails, automatically creates a GitHub issue
56+
- If any compilation fails, automatically creates a GitHub issue
4357
- Assigns the issue to the copilot user
4458
- Labels the issue with: `arduino`, `compilation-error`, `bug`
4559
- Mentions @copilot in the issue body for notifications
@@ -75,24 +89,37 @@ You can test Arduino compilation locally using Arduino CLI:
7589
# Install Arduino CLI
7690
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
7791

78-
# Install the SAMD core
92+
# Install cores
7993
arduino-cli core update-index
8094
arduino-cli core install arduino:samd
95+
arduino-cli core install arduino:mbed_opta
8196

8297
# Install required libraries
98+
arduino-cli lib update-index
8399
arduino-cli lib install "MKRNB"
84100
arduino-cli lib install "SD"
85101
arduino-cli lib install "ArduinoLowPower"
86102
arduino-cli lib install "RTCZero"
87103
arduino-cli lib install "Ethernet"
104+
arduino-cli lib install "ArduinoJson"
105+
arduino-cli lib install "Blues Wireless Notecard"
88106

89-
# Compile the client sketch
107+
# Compile TankAlarm-092025 sketches
90108
arduino-cli compile --fqbn arduino:samd:mkrnb1500 \
91109
TankAlarm-092025-Client-Hologram/TankAlarm-092025-Client-Hologram.ino
92110

93-
# Compile the server sketch
94111
arduino-cli compile --fqbn arduino:samd:mkrnb1500 \
95112
TankAlarm-092025-Server-Hologram/TankAlarm-092025-Server-Hologram.ino
113+
114+
# Compile TankAlarm-112025 sketches
115+
arduino-cli compile --fqbn arduino:mbed_opta:opta \
116+
TankAlarm-112025-Client-BluesOpta/TankAlarm-112025-Client-BluesOpta.ino
117+
118+
arduino-cli compile --fqbn arduino:mbed_opta:opta \
119+
TankAlarm-112025-Server-BluesOpta/TankAlarm-112025-Server-BluesOpta.ino
120+
121+
arduino-cli compile --fqbn arduino:mbed_opta:opta \
122+
TankAlarm-112025-Viewer-BluesOpta/TankAlarm-112025-Viewer-BluesOpta.ino
96123
```
97124

98125
### Troubleshooting

.github/workflows/arduino-ci.yml

Lines changed: 81 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
name: Arduino CI - TankAlarm 092025
1+
name: Arduino CI - TankAlarm 092025 & 112025
22

33
on:
44
push:
55
branches: [main, master]
66
paths:
77
- 'TankAlarm-092025-Client-Hologram/**'
88
- 'TankAlarm-092025-Server-Hologram/**'
9+
- 'TankAlarm-112025-Client-BluesOpta/**'
10+
- 'TankAlarm-112025-Server-BluesOpta/**'
11+
- 'TankAlarm-112025-Viewer-BluesOpta/**'
912
- '.github/workflows/arduino-ci.yml'
1013
pull_request:
1114
branches: [main, master]
1215
paths:
1316
- 'TankAlarm-092025-Client-Hologram/**'
1417
- 'TankAlarm-092025-Server-Hologram/**'
18+
- 'TankAlarm-112025-Client-BluesOpta/**'
19+
- 'TankAlarm-112025-Server-BluesOpta/**'
20+
- 'TankAlarm-112025-Viewer-BluesOpta/**'
1521
- '.github/workflows/arduino-ci.yml'
1622
workflow_dispatch:
1723

@@ -33,6 +39,11 @@ jobs:
3339
arduino-cli core update-index
3440
arduino-cli core install arduino:samd
3541
42+
- name: Install Arduino Mbed OS Opta Boards core
43+
run: |
44+
arduino-cli core update-index
45+
arduino-cli core install arduino:mbed_opta
46+
3647
- name: Install required libraries
3748
run: |
3849
arduino-cli lib update-index
@@ -41,6 +52,8 @@ jobs:
4152
arduino-cli lib install "Arduino Low Power"
4253
arduino-cli lib install "RTCZero"
4354
arduino-cli lib install "Ethernet"
55+
arduino-cli lib install "ArduinoJson"
56+
arduino-cli lib install "Blues Wireless Notecard"
4457
4558
- name: Compile TankAlarm-092025-Client-Hologram
4659
id: compile-client
@@ -56,8 +69,34 @@ jobs:
5669
arduino-cli compile --fqbn arduino:samd:mkrnb1500 \
5770
TankAlarm-092025-Server-Hologram/TankAlarm-092025-Server-Hologram.ino
5871
72+
- name: Compile TankAlarm-112025-Client-BluesOpta
73+
id: compile-112025-client
74+
continue-on-error: true
75+
run: |
76+
arduino-cli compile --fqbn arduino:mbed_opta:opta \
77+
TankAlarm-112025-Client-BluesOpta/TankAlarm-112025-Client-BluesOpta.ino
78+
79+
- name: Compile TankAlarm-112025-Server-BluesOpta
80+
id: compile-112025-server
81+
continue-on-error: true
82+
run: |
83+
arduino-cli compile --fqbn arduino:mbed_opta:opta \
84+
TankAlarm-112025-Server-BluesOpta/TankAlarm-112025-Server-BluesOpta.ino
85+
86+
- name: Compile TankAlarm-112025-Viewer-BluesOpta
87+
id: compile-112025-viewer
88+
continue-on-error: true
89+
run: |
90+
arduino-cli compile --fqbn arduino:mbed_opta:opta \
91+
TankAlarm-112025-Viewer-BluesOpta/TankAlarm-112025-Viewer-BluesOpta.ino
92+
5993
- name: Create issue on compilation failure
60-
if: steps.compile-client.outcome == 'failure' || steps.compile-server.outcome == 'failure'
94+
if: |
95+
steps.compile-client.outcome == 'failure' ||
96+
steps.compile-server.outcome == 'failure' ||
97+
steps.compile-112025-client.outcome == 'failure' ||
98+
steps.compile-112025-server.outcome == 'failure' ||
99+
steps.compile-112025-viewer.outcome == 'failure'
61100
uses: actions/github-script@v7
62101
with:
63102
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -68,41 +107,47 @@ jobs:
68107
// Determine which sketch(es) failed
69108
const clientFailed = '${{ steps.compile-client.outcome }}' === 'failure';
70109
const serverFailed = '${{ steps.compile-server.outcome }}' === 'failure';
110+
const client112025Failed = '${{ steps.compile-112025-client.outcome }}' === 'failure';
111+
const server112025Failed = '${{ steps.compile-112025-server.outcome }}' === 'failure';
112+
const viewer112025Failed = '${{ steps.compile-112025-viewer.outcome }}' === 'failure';
71113
72-
let sketchName = '';
73-
let searchPattern = '';
74-
if (clientFailed && serverFailed) {
75-
sketchName = 'TankAlarm-092025 Client and Server';
76-
searchPattern = 'Arduino Compilation Error in TankAlarm-092025';
77-
} else if (clientFailed) {
78-
sketchName = 'TankAlarm-092025-Client-Hologram';
79-
searchPattern = 'Arduino Compilation Error in TankAlarm-092025-Client-Hologram';
80-
} else {
81-
sketchName = 'TankAlarm-092025-Server-Hologram';
82-
searchPattern = 'Arduino Compilation Error in TankAlarm-092025-Server-Hologram';
83-
}
114+
const failedSketches = [];
115+
if (clientFailed) failedSketches.push('TankAlarm-092025-Client-Hologram');
116+
if (serverFailed) failedSketches.push('TankAlarm-092025-Server-Hologram');
117+
if (client112025Failed) failedSketches.push('TankAlarm-112025-Client-BluesOpta');
118+
if (server112025Failed) failedSketches.push('TankAlarm-112025-Server-BluesOpta');
119+
if (viewer112025Failed) failedSketches.push('TankAlarm-112025-Viewer-BluesOpta');
120+
121+
const sketchName = failedSketches.length === 1 ? failedSketches[0] :
122+
failedSketches.length > 1 ? 'Multiple Sketches' : 'Unknown';
123+
const searchPattern = 'Arduino Compilation Error';
84124
85125
const issueTitle = `Arduino Compilation Error in ${sketchName} (${date})`;
86126
const workflowUrl = '${{ github.server_url }}/' +
87127
'${{ github.repository }}/actions/runs/${{ github.run_id }}';
88128
89129
let detailsSection = '### Details\n';
90-
if (clientFailed) {
91-
detailsSection += `- **Client Sketch:** TankAlarm-092025-Client-Hologram/` +
92-
`TankAlarm-092025-Client-Hologram.ino ❌\n`;
93-
} else {
94-
detailsSection += `- **Client Sketch:** TankAlarm-092025-Client-Hologram/` +
95-
`TankAlarm-092025-Client-Hologram.ino ✅\n`;
96-
}
97-
if (serverFailed) {
98-
detailsSection += `- **Server Sketch:** TankAlarm-092025-Server-Hologram/` +
99-
`TankAlarm-092025-Server-Hologram.ino ❌\n`;
100-
} else {
101-
detailsSection += `- **Server Sketch:** TankAlarm-092025-Server-Hologram/` +
102-
`TankAlarm-092025-Server-Hologram.ino ✅\n`;
103-
}
104-
detailsSection += `- **Board:** Arduino MKR NB 1500 (arduino:samd:mkrnb1500)\n`;
105-
detailsSection += `- **Triggered by:** ${{ github.event_name }}`;
130+
131+
// TankAlarm-092025 sketches
132+
detailsSection += `#### TankAlarm-092025 (MKR NB 1500)\n`;
133+
detailsSection += `- **Client Sketch:** TankAlarm-092025-Client-Hologram/` +
134+
`TankAlarm-092025-Client-Hologram.ino ${clientFailed ? '❌' : '✅'}\n`;
135+
detailsSection += `- **Server Sketch:** TankAlarm-092025-Server-Hologram/` +
136+
`TankAlarm-092025-Server-Hologram.ino ${serverFailed ? '❌' : '✅'}\n`;
137+
138+
// TankAlarm-112025 sketches
139+
detailsSection += `\n#### TankAlarm-112025 (Arduino Opta)\n`;
140+
detailsSection += `- **Client Sketch:** TankAlarm-112025-Client-BluesOpta/` +
141+
`TankAlarm-112025-Client-BluesOpta.ino ${client112025Failed ? '❌' : '✅'}\n`;
142+
detailsSection += `- **Server Sketch:** TankAlarm-112025-Server-BluesOpta/` +
143+
`TankAlarm-112025-Server-BluesOpta.ino ${server112025Failed ? '❌' : '✅'}\n`;
144+
detailsSection += `- **Viewer Sketch:** TankAlarm-112025-Viewer-BluesOpta/` +
145+
`TankAlarm-112025-Viewer-BluesOpta.ino ${viewer112025Failed ? '❌' : '✅'}\n`;
146+
147+
detailsSection += `\n**Boards:**\n`;
148+
detailsSection += `- Arduino MKR NB 1500 (arduino:samd:mkrnb1500)\n`;
149+
detailsSection += `- Arduino Opta (arduino:mbed_opta:opta)\n`;
150+
detailsSection += `\n**Triggered by:** ${{ github.event_name }}`;
106151
107152
const issueBody = `## Arduino Compilation Failed
108153
@@ -161,5 +206,10 @@ jobs:
161206
}
162207
163208
- name: Fail workflow if compilation failed
164-
if: steps.compile-client.outcome == 'failure' || steps.compile-server.outcome == 'failure'
209+
if: |
210+
steps.compile-client.outcome == 'failure' ||
211+
steps.compile-server.outcome == 'failure' ||
212+
steps.compile-112025-client.outcome == 'failure' ||
213+
steps.compile-112025-server.outcome == 'failure' ||
214+
steps.compile-112025-viewer.outcome == 'failure'
165215
run: exit 1

0 commit comments

Comments
 (0)