-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (82 loc) · 3.2 KB
/
compile-sketches.yaml
File metadata and controls
89 lines (82 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Ref: https://github.com/rt-net/pico_micro_ros_arduino_examples/blob/main/.github/workflows/compile-sketches.yaml
name: Compile Sketches
on:
push:
paths:
- 'vssl_main/**'
pull_request:
paths:
- 'vssl_main/**'
workflow_dispatch:
env:
# It's convenient to set variables for values used multiple times in the workflow
SKETCHES_REPORTS_PATH: sketches-reports
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
jobs:
compile-sketches:
strategy:
matrix:
env:
- { FQBN: m5stack-core-esp32, NEED_REPORT: true }
- { FQBN: stamp-s3, NEED_REPORT: false }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Copy nanopb files
run: |
cp nanopb/*.h vssl_main
cp nanopb/*.c vssl_main
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Compile vssl_protocol files
run: |
pip install protobuf grpcio-tools
python3 nanopb/generator/nanopb_generator.py -Q quote -L quote -I vssl_protocol/proto vssl_protocol/proto/vssl_robot_control.proto -D vssl_main
- uses: arduino/compile-sketches@v1
with:
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
github-token: ${{ secrets.GITHUB_TOKEN }}
fqbn: m5stack:esp32:${{ matrix.env.FQBN }}
platforms: | # M5Stack公式のpackage indexを使用する
- name: m5stack:esp32
version: 2.0.7
source-url: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
libraries: |
- name: M5Unified
version: 0.1.9
- name: M5GFX
version: 0.1.9
- name: FastLED
version: 3.6.0
cli-compile-flags: | # 警告がエラーとして扱われるので、対処しない警告を除外する
- --build-property
- "compiler.cpp.extra_flags= \
-Wno-error=unused-variable" # M5Unified側のエラー
sketch-paths: |
- vssl_main
# This step is needed to pass the size data to the report job
- name: Upload sketches report to workflow artifact
if: ${{ matrix.env.NEED_REPORT }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
path: ${{ env.SKETCHES_REPORTS_PATH }}
report:
needs: compile-sketches # Wait for the compile job to finish to get the data for the report
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
runs-on: ubuntu-latest
steps:
# This step is needed to get the size data produced by the compile jobs
- name: Download sketches reports artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
path: ${{ env.SKETCHES_REPORTS_PATH }}
- uses: arduino/report-size-deltas@v1
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
github-token: ${{ secrets.GITHUB_TOKEN }}