Skip to content

Commit 3a97783

Browse files
Copilotdorkmo
andcommitted
Add automatic issue creation on Arduino compilation failure
Co-authored-by: dorkmo <1923070+dorkmo@users.noreply.github.com>
1 parent 4cec5db commit 3a97783

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.github/workflows/arduino-ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ jobs:
2121
name: Compile Arduino Opta Controller
2222
permissions:
2323
contents: read
24+
issues: write
2425

2526
steps:
2627
- name: Checkout repository
2728
uses: actions/checkout@v4
2829

2930
- name: Compile Arduino Opta sketch
31+
id: compile-opta
32+
continue-on-error: true
3033
uses: arduino/compile-sketches@v1
3134
with:
3235
fqbn: 'arduino:mbed_opta:opta'
@@ -49,18 +52,52 @@ jobs:
4952
name: opta-controller-report
5053
path: sketches-reports
5154
retention-days: 30
55+
56+
- name: Create issue on compilation failure
57+
if: failure() && steps.compile-opta.outcome == 'failure'
58+
uses: actions/github-script@v7
59+
with:
60+
script: |
61+
const issue = await github.rest.issues.create({
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
title: '🔴 Arduino Opta Controller compilation failed',
65+
body: `## Compilation Error
66+
67+
The Arduino Opta Controller sketch failed to compile.
68+
69+
**Workflow Run:** [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
70+
**Commit:** ${{ github.sha }}
71+
**Branch:** ${{ github.ref_name }}
72+
73+
### Details
74+
- **Sketch:** \`LifeTrac-v25/arduino_opta_controller\`
75+
- **Board:** \`arduino:mbed_opta:opta\`
76+
- **Triggered by:** ${{ github.event_name }}
77+
78+
Please review the workflow logs to identify and fix the compilation errors.
79+
80+
---
81+
*This issue was automatically created by the Arduino CI workflow.*`,
82+
labels: ['bug', 'arduino', 'ci'],
83+
assignees: ['Copilot']
84+
});
85+
console.log(`Created issue #${issue.data.number}`)
5286
5387
compile-esp32-remote:
5488
runs-on: ubuntu-latest
5589
name: Compile ESP32 Remote Control
5690
permissions:
5791
contents: read
92+
issues: write
5893

5994
steps:
6095
- name: Checkout repository
6196
uses: actions/checkout@v4
6297

6398
- name: Compile ESP32 sketch
99+
id: compile-esp32
100+
continue-on-error: true
64101
uses: arduino/compile-sketches@v1
65102
with:
66103
fqbn: 'esp32:esp32:esp32thing_plus'
@@ -83,3 +120,34 @@ jobs:
83120
name: esp32-remote-report
84121
path: sketches-reports
85122
retention-days: 30
123+
124+
- name: Create issue on compilation failure
125+
if: failure() && steps.compile-esp32.outcome == 'failure'
126+
uses: actions/github-script@v7
127+
with:
128+
script: |
129+
const issue = await github.rest.issues.create({
130+
owner: context.repo.owner,
131+
repo: context.repo.repo,
132+
title: '🔴 ESP32 Remote Control compilation failed',
133+
body: `## Compilation Error
134+
135+
The ESP32 Remote Control sketch failed to compile.
136+
137+
**Workflow Run:** [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
138+
**Commit:** ${{ github.sha }}
139+
**Branch:** ${{ github.ref_name }}
140+
141+
### Details
142+
- **Sketch:** \`LifeTrac-v25/esp32_remote_control\`
143+
- **Board:** \`esp32:esp32:esp32thing_plus\`
144+
- **Triggered by:** ${{ github.event_name }}
145+
146+
Please review the workflow logs to identify and fix the compilation errors.
147+
148+
---
149+
*This issue was automatically created by the Arduino CI workflow.*`,
150+
labels: ['bug', 'arduino', 'ci'],
151+
assignees: ['Copilot']
152+
});
153+
console.log(`Created issue #${issue.data.number}`)

LifeTrac-v25/ARDUINO_CI.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ The workflow generates compilation reports showing:
3636

3737
These reports are uploaded as artifacts and retained for 30 days.
3838

39+
## Automatic Issue Creation
40+
41+
When a compilation error occurs, the workflow automatically creates a GitHub issue with:
42+
- A descriptive title indicating which sketch failed (Opta Controller or ESP32 Remote)
43+
- Link to the failed workflow run
44+
- Commit and branch information
45+
- Details about the sketch and board configuration
46+
- The issue is automatically labeled with `bug`, `arduino`, and `ci`
47+
- The issue is automatically assigned to @Copilot for investigation
48+
49+
This ensures compilation failures are tracked and addressed promptly.
50+
3951
## Running CI Manually
4052

4153
The workflow can be triggered manually:

0 commit comments

Comments
 (0)