Skip to content

Commit 82d3ac6

Browse files
Copilotdorkmo
andcommitted
Split GitHub Actions workflows into separate 092025 and 112025 workflows
Co-authored-by: dorkmo <[email protected]>
1 parent 27da2a9 commit 82d3ac6

File tree

2 files changed

+170
-55
lines changed

2 files changed

+170
-55
lines changed
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: Arduino CI - TankAlarm 092025 (Hologram)
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- 'TankAlarm-092025-Client-Hologram/**'
8+
- 'TankAlarm-092025-Server-Hologram/**'
9+
- '.github/workflows/arduino-ci-092025.yml'
10+
pull_request:
11+
branches: [main, master]
12+
paths:
13+
- 'TankAlarm-092025-Client-Hologram/**'
14+
- 'TankAlarm-092025-Server-Hologram/**'
15+
- '.github/workflows/arduino-ci-092025.yml'
16+
workflow_dispatch:
17+
18+
jobs:
19+
compile-arduino-092025:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
issues: write
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Arduino CLI
29+
uses: arduino/setup-arduino-cli@v1
30+
31+
- name: Install Arduino SAMD core
32+
run: |
33+
arduino-cli core update-index
34+
arduino-cli core install arduino:samd
35+
36+
- name: Install required libraries for 092025
37+
run: |
38+
arduino-cli lib update-index
39+
arduino-cli lib install "MKRNB"
40+
arduino-cli lib install "SD"
41+
arduino-cli lib install "Arduino Low Power"
42+
arduino-cli lib install "RTCZero"
43+
44+
- name: Compile TankAlarm-092025-Client-Hologram
45+
id: compile-client
46+
continue-on-error: true
47+
run: |
48+
arduino-cli compile --fqbn arduino:samd:mkrnb1500 \
49+
TankAlarm-092025-Client-Hologram/TankAlarm-092025-Client-Hologram.ino
50+
51+
- name: Compile TankAlarm-092025-Server-Hologram
52+
id: compile-server
53+
continue-on-error: true
54+
run: |
55+
arduino-cli compile --fqbn arduino:samd:mkrnb1500 \
56+
TankAlarm-092025-Server-Hologram/TankAlarm-092025-Server-Hologram.ino
57+
58+
- name: Create issue on compilation failure
59+
if: |
60+
steps.compile-client.outcome == 'failure' ||
61+
steps.compile-server.outcome == 'failure'
62+
uses: actions/github-script@v7
63+
with:
64+
github-token: ${{ secrets.GITHUB_TOKEN }}
65+
script: |
66+
const fs = require('fs');
67+
const date = new Date().toISOString().split('T')[0];
68+
69+
// Determine which sketch(es) failed
70+
const clientFailed = '${{ steps.compile-client.outcome }}' === 'failure';
71+
const serverFailed = '${{ steps.compile-server.outcome }}' === 'failure';
72+
73+
const failedSketches = [];
74+
if (clientFailed) failedSketches.push('TankAlarm-092025-Client-Hologram');
75+
if (serverFailed) failedSketches.push('TankAlarm-092025-Server-Hologram');
76+
77+
const sketchName = failedSketches.length === 1 ? failedSketches[0] :
78+
failedSketches.length > 1 ? 'Multiple Sketches (092025)' : 'Unknown';
79+
const searchPattern = 'Arduino Compilation Error - 092025';
80+
81+
const issueTitle = `Arduino Compilation Error in ${sketchName} (${date})`;
82+
const workflowUrl = '${{ github.server_url }}/' +
83+
'${{ github.repository }}/actions/runs/${{ github.run_id }}';
84+
85+
let detailsSection = '### Details\n';
86+
87+
// TankAlarm-092025 sketches
88+
detailsSection += `#### TankAlarm-092025 (MKR NB 1500)\n`;
89+
detailsSection += `- **Client Sketch:** TankAlarm-092025-Client-Hologram/` +
90+
`TankAlarm-092025-Client-Hologram.ino ${clientFailed ? '❌' : '✅'}\n`;
91+
detailsSection += `- **Server Sketch:** TankAlarm-092025-Server-Hologram/` +
92+
`TankAlarm-092025-Server-Hologram.ino ${serverFailed ? '❌' : '✅'}\n`;
93+
94+
detailsSection += `\n**Board:**\n`;
95+
detailsSection += `- Arduino MKR NB 1500 (arduino:samd:mkrnb1500)\n`;
96+
detailsSection += `\n**Triggered by:** ${{ github.event_name }}`;
97+
98+
const issueBody = `## Arduino Compilation Failed - TankAlarm 092025
99+
100+
The Arduino code compilation failed for the TankAlarm-092025 (Hologram) projects.
101+
102+
**Workflow Run:** ${workflowUrl}
103+
**Commit:** ${{ github.sha }}
104+
**Branch:** ${{ github.ref_name }}
105+
106+
${detailsSection}
107+
108+
### Next Steps
109+
1. Review the workflow logs for detailed error messages
110+
2. Fix compilation errors in the Arduino code
111+
3. Re-run the workflow to verify the fix
112+
113+
/cc @copilot`;
114+
115+
// Check if a similar open issue already exists
116+
const existingIssues = await github.rest.issues.listForRepo({
117+
owner: context.repo.owner,
118+
repo: context.repo.repo,
119+
state: 'open',
120+
labels: ['arduino', 'compilation-error'],
121+
per_page: 10
122+
});
123+
124+
const duplicateIssue = existingIssues.data.find(issue =>
125+
issue.title.includes(searchPattern)
126+
);
127+
128+
if (duplicateIssue) {
129+
// Add a comment to existing issue instead of creating new one
130+
const commentBody = `Another compilation failure detected:\n\n` +
131+
`**Workflow Run:** ${workflowUrl}\n` +
132+
`**Commit:** ${{ github.sha }}\n` +
133+
`**Branch:** ${{ github.ref_name }}\n\n` +
134+
detailsSection;
135+
await github.rest.issues.createComment({
136+
owner: context.repo.owner,
137+
repo: context.repo.repo,
138+
issue_number: duplicateIssue.number,
139+
body: commentBody
140+
});
141+
console.log(`Updated existing issue #${duplicateIssue.number}`);
142+
} else {
143+
// Create a new issue
144+
const issue = await github.rest.issues.create({
145+
owner: context.repo.owner,
146+
repo: context.repo.repo,
147+
title: issueTitle,
148+
body: issueBody,
149+
labels: ['arduino', 'compilation-error', 'bug', '092025']
150+
});
151+
console.log(`Created issue #${issue.data.number}`);
152+
}
153+
154+
- name: Fail workflow if compilation failed
155+
if: |
156+
steps.compile-client.outcome == 'failure' ||
157+
steps.compile-server.outcome == 'failure'
158+
run: exit 1
Lines changed: 12 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
name: Arduino CI - TankAlarm 092025 & 112025
1+
name: Arduino CI - TankAlarm 112025 (Blues Opta)
22

33
on:
44
push:
55
branches: [main, master]
66
paths:
7-
- 'TankAlarm-092025-Client-Hologram/**'
8-
- 'TankAlarm-092025-Server-Hologram/**'
97
- 'TankAlarm-112025-Client-BluesOpta/**'
108
- 'TankAlarm-112025-Server-BluesOpta/**'
119
- 'TankAlarm-112025-Viewer-BluesOpta/**'
12-
- '.github/workflows/arduino-ci.yml'
10+
- '.github/workflows/arduino-ci-112025.yml'
1311
pull_request:
1412
branches: [main, master]
1513
paths:
16-
- 'TankAlarm-092025-Client-Hologram/**'
17-
- 'TankAlarm-092025-Server-Hologram/**'
1814
- 'TankAlarm-112025-Client-BluesOpta/**'
1915
- 'TankAlarm-112025-Server-BluesOpta/**'
2016
- 'TankAlarm-112025-Viewer-BluesOpta/**'
21-
- '.github/workflows/arduino-ci.yml'
17+
- '.github/workflows/arduino-ci-112025.yml'
2218
workflow_dispatch:
2319

2420
jobs:
25-
compile-arduino:
21+
compile-arduino-112025:
2622
runs-on: ubuntu-latest
2723
permissions:
2824
contents: read
@@ -34,41 +30,18 @@ jobs:
3430
- name: Setup Arduino CLI
3531
uses: arduino/setup-arduino-cli@v1
3632

37-
- name: Install Arduino SAMD core
38-
run: |
39-
arduino-cli core update-index
40-
arduino-cli core install arduino:samd
41-
4233
- name: Install Arduino Mbed OS Opta Boards core
4334
run: |
4435
arduino-cli core update-index
4536
arduino-cli core install arduino:mbed_opta
4637
47-
- name: Install required libraries
38+
- name: Install required libraries for 112025
4839
run: |
4940
arduino-cli lib update-index
50-
arduino-cli lib install "MKRNB"
51-
arduino-cli lib install "SD"
52-
arduino-cli lib install "Arduino Low Power"
53-
arduino-cli lib install "RTCZero"
5441
arduino-cli lib install "Ethernet"
5542
arduino-cli lib install "ArduinoJson"
5643
arduino-cli lib install "Blues Wireless Notecard"
5744
58-
- name: Compile TankAlarm-092025-Client-Hologram
59-
id: compile-client
60-
continue-on-error: true
61-
run: |
62-
arduino-cli compile --fqbn arduino:samd:mkrnb1500 \
63-
TankAlarm-092025-Client-Hologram/TankAlarm-092025-Client-Hologram.ino
64-
65-
- name: Compile TankAlarm-092025-Server-Hologram
66-
id: compile-server
67-
continue-on-error: true
68-
run: |
69-
arduino-cli compile --fqbn arduino:samd:mkrnb1500 \
70-
TankAlarm-092025-Server-Hologram/TankAlarm-092025-Server-Hologram.ino
71-
7245
- name: Compile TankAlarm-112025-Client-BluesOpta
7346
id: compile-112025-client
7447
continue-on-error: true
@@ -92,8 +65,6 @@ jobs:
9265
9366
- name: Create issue on compilation failure
9467
if: |
95-
steps.compile-client.outcome == 'failure' ||
96-
steps.compile-server.outcome == 'failure' ||
9768
steps.compile-112025-client.outcome == 'failure' ||
9869
steps.compile-112025-server.outcome == 'failure' ||
9970
steps.compile-112025-viewer.outcome == 'failure'
@@ -105,53 +76,41 @@ jobs:
10576
const date = new Date().toISOString().split('T')[0];
10677
10778
// Determine which sketch(es) failed
108-
const clientFailed = '${{ steps.compile-client.outcome }}' === 'failure';
109-
const serverFailed = '${{ steps.compile-server.outcome }}' === 'failure';
11079
const client112025Failed = '${{ steps.compile-112025-client.outcome }}' === 'failure';
11180
const server112025Failed = '${{ steps.compile-112025-server.outcome }}' === 'failure';
11281
const viewer112025Failed = '${{ steps.compile-112025-viewer.outcome }}' === 'failure';
11382
11483
const failedSketches = [];
115-
if (clientFailed) failedSketches.push('TankAlarm-092025-Client-Hologram');
116-
if (serverFailed) failedSketches.push('TankAlarm-092025-Server-Hologram');
11784
if (client112025Failed) failedSketches.push('TankAlarm-112025-Client-BluesOpta');
11885
if (server112025Failed) failedSketches.push('TankAlarm-112025-Server-BluesOpta');
11986
if (viewer112025Failed) failedSketches.push('TankAlarm-112025-Viewer-BluesOpta');
12087
12188
const sketchName = failedSketches.length === 1 ? failedSketches[0] :
122-
failedSketches.length > 1 ? 'Multiple Sketches' : 'Unknown';
123-
const searchPattern = 'Arduino Compilation Error';
89+
failedSketches.length > 1 ? 'Multiple Sketches (112025)' : 'Unknown';
90+
const searchPattern = 'Arduino Compilation Error - 112025';
12491
12592
const issueTitle = `Arduino Compilation Error in ${sketchName} (${date})`;
12693
const workflowUrl = '${{ github.server_url }}/' +
12794
'${{ github.repository }}/actions/runs/${{ github.run_id }}';
12895
12996
let detailsSection = '### Details\n';
13097
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-
13898
// TankAlarm-112025 sketches
139-
detailsSection += `\n#### TankAlarm-112025 (Arduino Opta)\n`;
99+
detailsSection += `#### TankAlarm-112025 (Arduino Opta)\n`;
140100
detailsSection += `- **Client Sketch:** TankAlarm-112025-Client-BluesOpta/` +
141101
`TankAlarm-112025-Client-BluesOpta.ino ${client112025Failed ? '❌' : '✅'}\n`;
142102
detailsSection += `- **Server Sketch:** TankAlarm-112025-Server-BluesOpta/` +
143103
`TankAlarm-112025-Server-BluesOpta.ino ${server112025Failed ? '❌' : '✅'}\n`;
144104
detailsSection += `- **Viewer Sketch:** TankAlarm-112025-Viewer-BluesOpta/` +
145105
`TankAlarm-112025-Viewer-BluesOpta.ino ${viewer112025Failed ? '❌' : '✅'}\n`;
146106
147-
detailsSection += `\n**Boards:**\n`;
148-
detailsSection += `- Arduino MKR NB 1500 (arduino:samd:mkrnb1500)\n`;
107+
detailsSection += `\n**Board:**\n`;
149108
detailsSection += `- Arduino Opta (arduino:mbed_opta:opta)\n`;
150109
detailsSection += `\n**Triggered by:** ${{ github.event_name }}`;
151110
152-
const issueBody = `## Arduino Compilation Failed
111+
const issueBody = `## Arduino Compilation Failed - TankAlarm 112025
153112
154-
The Arduino code compilation failed in the CI workflow.
113+
The Arduino code compilation failed for the TankAlarm-112025 (Blues Opta) projects.
155114
156115
**Workflow Run:** ${workflowUrl}
157116
**Commit:** ${{ github.sha }}
@@ -200,15 +159,13 @@ jobs:
200159
repo: context.repo.repo,
201160
title: issueTitle,
202161
body: issueBody,
203-
labels: ['arduino', 'compilation-error', 'bug']
162+
labels: ['arduino', 'compilation-error', 'bug', '112025']
204163
});
205164
console.log(`Created issue #${issue.data.number}`);
206165
}
207166
208167
- name: Fail workflow if compilation failed
209168
if: |
210-
steps.compile-client.outcome == 'failure' ||
211-
steps.compile-server.outcome == 'failure' ||
212169
steps.compile-112025-client.outcome == 'failure' ||
213170
steps.compile-112025-server.outcome == 'failure' ||
214171
steps.compile-112025-viewer.outcome == 'failure'

0 commit comments

Comments
 (0)