Skip to content

Commit 1ff9438

Browse files
committed
add workflows arduino lint and update compile.sh
1 parent 6a65a64 commit 1ff9438

File tree

6 files changed

+47
-4
lines changed

6 files changed

+47
-4
lines changed

.github/actions/arduino-test-compile.sh

+21
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,27 @@ if [[ -f $GITHUB_WORKSPACE/library.properties ]]; then
171171
fi
172172
fi
173173

174+
if [[ -f $GITHUB_WORKSPACE/library.properties ]]; then
175+
OLD_IFS="$IFS"
176+
IFS=$'\n'
177+
for line in `cat $GITHUB_WORKSPACE/library.properties`
178+
do
179+
result=$(echo $line | grep "depends=")
180+
if [[ "$result" != "" ]]
181+
then
182+
depends_str=${line##*depends=}
183+
IFS=","
184+
for lib in ${depends_str[@]}
185+
do
186+
echo "download $lib"
187+
arduino-cli lib install $lib
188+
done;
189+
fi
190+
done
191+
IFS="$OLD_IFS"
192+
fi
193+
194+
174195
#
175196
# Update index and install the required board platform
176197
#
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Arduino Lint
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
jobs:
8+
lint:
9+
name: Lint Check
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: arduino/arduino-lint-action@v1
14+
with:
15+
library-manager: update
16+
compliance: strict
17+
project-type: all

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# M5Paper Library
33

44
[![Arduino Compile](https://github.com/m5stack/M5EPD/actions/workflows/arduino-action-paper-compile.yml/badge.svg)](https://github.com/m5stack/M5EPD/actions/workflows/arduino-action-paper-compile.yml)
5+
[![Arduino Lint](https://github.com/m5stack/M5EPD/actions/workflows/Arduino-Lint-Check.yml/badge.svg)](https://github.com/m5stack/M5EPD/actions/workflows/Arduino-Lint-Check.yml)
56
[![Clang Format](https://github.com/m5stack/M5EPD/actions/workflows/clang-format-check.yml/badge.svg)](https://github.com/m5stack/M5EPD/blob/main/.github/workflows/clang-format-check.yml)
67

78

README_cn.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# M5Paper Library
22

3+
[![Arduino Compile](https://github.com/m5stack/M5EPD/actions/workflows/arduino-action-paper-compile.yml/badge.svg)](https://github.com/m5stack/M5EPD/actions/workflows/arduino-action-paper-compile.yml)
4+
[![Arduino Lint](https://github.com/m5stack/M5EPD/actions/workflows/Arduino-Lint-Check.yml/badge.svg)](https://github.com/m5stack/M5EPD/actions/workflows/Arduino-Lint-Check.yml)
5+
[![Clang Format](https://github.com/m5stack/M5EPD/actions/workflows/clang-format-check.yml/badge.svg)](https://github.com/m5stack/M5EPD/blob/main/.github/workflows/clang-format-check.yml)
6+
37
[English](README.md) | 中文
48

59
![M5Paper_Pic_01](https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/product_jpg/assets/img/product_pics/core/m5paper/m5paper_01.jpg)

examples/Unit/KEY/KEY.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ void changeLedColor();
3434
void setup() {
3535
M5.begin(); // Init M5Stack 初始化M5Stack
3636
M5.EPD.SetRotation(
37-
90); // Set the rotation of the display. 设置屏幕旋转角度
37+
90); // Set the rotation of the display. 设置屏幕旋转角度
3838
M5.EPD.Clear(true); // Clear the screen. 清屏
3939
M5.RTC.begin(); // Init the RTC. 初始化 RTC
4040
canvas.createCanvas(540, 960); // Create a canvas. 创建画布
4141
canvas.setTextSize(3); // Set the text size. 设置文字大小
4242
canvas.drawString("UNIT-KEY Example", 135,
43-
350); // Draw a string. 绘制字符串
43+
350); // Draw a string. 绘制字符串
4444
canvas.pushCanvas(0, 0, UPDATE_MODE_DU4); // Update the screen. 更新屏幕
4545

4646
pinMode(KEY_PIN, INPUT_PULLUP); // Init Key pin. 初始化Key引脚.

examples/Unit/LIMIT/LIMIT.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ M5EPD_Canvas canvas(&M5.EPD);
2222
void setup() {
2323
M5.begin(); // Init M5Stack 初始化M5Stack
2424
M5.EPD.SetRotation(
25-
90); // Set the rotation of the display. 设置屏幕旋转角度
25+
90); // Set the rotation of the display. 设置屏幕旋转角度
2626
M5.EPD.Clear(true); // Clear the screen. 清屏
2727
M5.RTC.begin(); // Init the RTC. 初始化 RTC
2828
canvas.createCanvas(540, 960); // Create a canvas. 创建画布
2929
canvas.setTextSize(3); // Set the text size. 设置文字大小
3030
canvas.drawString("UNIT-LIMIT Example", 110,
31-
350); // Draw a string. 绘制字符串
31+
350); // Draw a string. 绘制字符串
3232
canvas.pushCanvas(0, 0, UPDATE_MODE_DU4); // Update the screen. 更新屏幕
3333

3434
Serial.begin(115200);

0 commit comments

Comments
 (0)