Skip to content

Commit b980e3c

Browse files
committed
CIの設定を追加
1 parent ed4c968 commit b980e3c

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Compile Sketches
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
pull_request:
8+
paths-ignore:
9+
- '**.md'
10+
workflow_dispatch:
11+
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:
18+
compile-sketches:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
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+
version: 3.1.3
32+
sketch-paths: |
33+
- pico_classic_v4_STEP1_LED
34+
- pico_classic_v4_STEP2_SWITCH
35+
- pico_classic_v4_STEP3_Buzzer
36+
- pico_classic_v4_STEP4_Sensor
37+
- pico_classic_v4_STEP5_Straight
38+
- pico_classic_v4_STEP6_rotate
39+
- pico_classic_v4_STEP7_P_control
40+
- pico_classic_v4_STEP8_micromouse
41+
42+
# This step is needed to pass the size data to the report job
43+
- name: Upload sketches report to workflow artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
47+
path: ${{ env.SKETCHES_REPORTS_PATH }}
48+
49+
report:
50+
needs: compile-sketches # Wait for the compile job to finish to get the data for the report
51+
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
52+
runs-on: ubuntu-latest
53+
steps:
54+
# This step is needed to get the size data produced by the compile jobs
55+
- name: Download sketches reports artifact
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
59+
path: ${{ env.SKETCHES_REPORTS_PATH }}
60+
continue-on-error: true
61+
62+
- uses: arduino/report-size-deltas@v1
63+
with:
64+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
65+
github-token: ${{ secrets.GITHUB_TOKEN }}
66+
continue-on-error: true

.github/workflows/lint.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
pull_request:
8+
paths-ignore:
9+
- '**.md'
10+
workflow_dispatch:
11+
12+
jobs:
13+
arduino-lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: arduino/arduino-lint-action@v2
18+
with:
19+
recursive: true
20+
compliance: specification
21+
clang-format:
22+
needs: arduino-lint
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
# 各スケッチファイルの.ino、.hファイルに対してclang-formatによる整形が必要か判定する
27+
# 正規表現を簡単にするためzshを使用する
28+
- run: sudo apt install -y clang-format zsh
29+
- run: clang-format --dry-run -Werror pico_classic_v4_STEP*/*.(ino|h)
30+
shell: zsh {0}

0 commit comments

Comments
 (0)