Skip to content

Commit 7fea06c

Browse files
author
Shota Aoki
authored
Add ci.yaml to build sketch files on Github Workflow. (#1)
* fix typo * fix indent * set fqbn for CI * Check STEP2 - STEP10 * add compile option for unused parameter and variables * update compile option * update compile option * Use micro_ros_arduino library * Use forked library * Change library url * ignore type-limits error * Update ignore options * Ignore STEP12, 12 test * Add STEP12 build * Add STEP13 build * Refactor ci.yaml * Refactor ci.yaml * Delete interrupt 2.c * Add status badge to README * Add report actions * fix typo
1 parent a683bd2 commit 7fea06c

File tree

3 files changed

+72
-163
lines changed

3 files changed

+72
-163
lines changed

.github/workflows/ci.yaml

Lines changed: 69 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,73 @@ on:
99
- '**.md'
1010
workflow_dispatch:
1111

12-
jobos:
12+
env:
13+
# It's convenient to set variables for values used multiple times in the workflow
14+
SKETCHES_REPORTS_PATH: sketches-reports
15+
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
16+
17+
jobs:
1318
compile-sketches:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v3
17-
- uses: arduino/compile-sketches@v1
18-
with:
19-
# 要修正
20-
fqbn: arduino:avr:uno
21-
sketch-paths: |
22-
- uROS_STEP1_LED
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: arduino/compile-sketches@v1
23+
with:
24+
enable-deltas-report: true
25+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
27+
fqbn: esp32:esp32:esp32s3
28+
platforms: | # ESP32公式のpackage indexを使用する
29+
- name: esp32:esp32
30+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
31+
libraries: | # RTがカスタマイズしたmicro_ros_arduinoライブラリを使用する
32+
- source-url: https://github.com/ShotaAk/micro_ros_arduino/archive/refs/tags/humble-add-custom-msg-esp32s3.zip
33+
cli-compile-flags: | # 警告がエラーとして扱われるので、対処しない警告はエラーから除外する
34+
- --build-property
35+
- "compiler.cpp.extra_flags= \
36+
-Wno-error=unused-but-set-parameter \
37+
-Wno-error=unused-but-set-variable \
38+
-Wno-error=unused-variable \
39+
-Wno-error=switch \
40+
-Wno-error=char-subscripts \
41+
-Wno-error=return-type \
42+
-Wno-error=type-limits \
43+
-Wno-error=ignored-qualifiers \
44+
-Wno-error=implicit-function-declaration"
45+
sketch-paths: |
46+
- uROS_STEP1_LED
47+
- uROS_STEP2_SWITCH
48+
- uROS_STEP3_Buzzer
49+
- uROS_STEP4_Sensor
50+
- uROS_STEP5_Straight
51+
- uROS_STEP6_rotate
52+
- uROS_STEP7_P_control
53+
- uROS_STEP8_micromouse
54+
- uROS_STEP10_twistMsg
55+
- uROS_STEP11_tfMsg
56+
- uROS_STEP12_SensorMsg
57+
- uROS_STEP13_micromouse
58+
59+
# This step is needed to pass the size data to the report job
60+
- name: Upload sketches report to workflow artifact
61+
uses: actions/upload-artifact@v3
62+
with:
63+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
64+
path: ${{ env.SKETCHES_REPORTS_PATH }}
65+
66+
report:
67+
needs: compile-sketches # Wait for the compile job to finish to get the data for the report
68+
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
69+
runs-on: ubuntu-latest
70+
steps:
71+
# This step is needed to get the size data produced by the compile jobs
72+
- name: Download sketches reports artifact
73+
uses: actions/download-artifact@v3
74+
with:
75+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
76+
path: ${{ env.SKETCHES_REPORTS_PATH }}
77+
78+
- uses: arduino/report-size-deltas@v1
79+
with:
80+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
81+
github-token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
# micro-ROS examples for Pi:Co Classic 3
1+
# micro-ROS Arduino examples for Pi:Co Classic 3
2+
3+
[![CI](https://github.com/rt-net/pico_micro_ros_examples/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/rt-net/pico_micro_ros_examples/actions/workflows/ci.yaml)
24

uROS_STEP13_micromouse/interrupt 2.c

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)