Skip to content

Commit

Permalink
add workflows arduino lint and update compile.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitshaoxiang committed Jul 31, 2023
1 parent 6a65a64 commit 1ff9438
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .github/actions/arduino-test-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,27 @@ if [[ -f $GITHUB_WORKSPACE/library.properties ]]; then
fi
fi

if [[ -f $GITHUB_WORKSPACE/library.properties ]]; then
OLD_IFS="$IFS"
IFS=$'\n'
for line in `cat $GITHUB_WORKSPACE/library.properties`
do
result=$(echo $line | grep "depends=")
if [[ "$result" != "" ]]
then
depends_str=${line##*depends=}
IFS=","
for lib in ${depends_str[@]}
do
echo "download $lib"
arduino-cli lib install $lib
done;
fi
done
IFS="$OLD_IFS"
fi


#
# Update index and install the required board platform
#
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/Arduino-Lint-Check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Arduino Lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
name: Lint Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update
compliance: strict
project-type: all
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# M5Paper Library

[![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)
[![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)
[![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)


Expand Down
4 changes: 4 additions & 0 deletions README_cn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# M5Paper Library

[![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)
[![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)
[![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)

[English](README.md) | 中文

![M5Paper_Pic_01](https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/product_jpg/assets/img/product_pics/core/m5paper/m5paper_01.jpg)
Expand Down
4 changes: 2 additions & 2 deletions examples/Unit/KEY/KEY.ino
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ void changeLedColor();
void setup() {
M5.begin(); // Init M5Stack 初始化M5Stack
M5.EPD.SetRotation(
90); // Set the rotation of the display. 设置屏幕旋转角度
90); // Set the rotation of the display. 设置屏幕旋转角度
M5.EPD.Clear(true); // Clear the screen. 清屏
M5.RTC.begin(); // Init the RTC. 初始化 RTC
canvas.createCanvas(540, 960); // Create a canvas. 创建画布
canvas.setTextSize(3); // Set the text size. 设置文字大小
canvas.drawString("UNIT-KEY Example", 135,
350); // Draw a string. 绘制字符串
350); // Draw a string. 绘制字符串
canvas.pushCanvas(0, 0, UPDATE_MODE_DU4); // Update the screen. 更新屏幕

pinMode(KEY_PIN, INPUT_PULLUP); // Init Key pin. 初始化Key引脚.
Expand Down
4 changes: 2 additions & 2 deletions examples/Unit/LIMIT/LIMIT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ M5EPD_Canvas canvas(&M5.EPD);
void setup() {
M5.begin(); // Init M5Stack 初始化M5Stack
M5.EPD.SetRotation(
90); // Set the rotation of the display. 设置屏幕旋转角度
90); // Set the rotation of the display. 设置屏幕旋转角度
M5.EPD.Clear(true); // Clear the screen. 清屏
M5.RTC.begin(); // Init the RTC. 初始化 RTC
canvas.createCanvas(540, 960); // Create a canvas. 创建画布
canvas.setTextSize(3); // Set the text size. 设置文字大小
canvas.drawString("UNIT-LIMIT Example", 110,
350); // Draw a string. 绘制字符串
350); // Draw a string. 绘制字符串
canvas.pushCanvas(0, 0, UPDATE_MODE_DU4); // Update the screen. 更新屏幕

Serial.begin(115200);
Expand Down

0 comments on commit 1ff9438

Please sign in to comment.