From 960fb184f3c832c96b24ea4f1615c8863412e330 Mon Sep 17 00:00:00 2001 From: Masahiro Tamegai Date: Mon, 24 Mar 2025 08:34:24 +0900 Subject: [PATCH 1/6] Add CI build --- .github/workflow/build.yml | 23 +++++++++++++++++++++++ .gitignore | 5 +++++ test/ci_build/platformio.ini | 7 +++++++ test/ci_build/src/main.cpp | 14 ++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 .github/workflow/build.yml create mode 100644 .gitignore create mode 100644 test/ci_build/platformio.ini create mode 100644 test/ci_build/src/main.cpp diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml new file mode 100644 index 0000000..6f93e0e --- /dev/null +++ b/.github/workflow/build.yml @@ -0,0 +1,23 @@ +name: ESP32 BLE Keyboard CI Build + +on: + push: + branches: [ main ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python and install PlatformIO + run: | + python3 -m pip install --upgrade platformio + + - name: Build with PlatformIO + run: | + cd test/ci_build + platformio run diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/test/ci_build/platformio.ini b/test/ci_build/platformio.ini new file mode 100644 index 0000000..0ea476a --- /dev/null +++ b/test/ci_build/platformio.ini @@ -0,0 +1,7 @@ +[env:esp32dev] +platform = espressif32 +board = esp32dev +framework = arduino +lib_ldf_mode = deep+ +lib_extra_dirs = ../ +lib_deps = ESP32 BLE Keyboard diff --git a/test/ci_build/src/main.cpp b/test/ci_build/src/main.cpp new file mode 100644 index 0000000..6066358 --- /dev/null +++ b/test/ci_build/src/main.cpp @@ -0,0 +1,14 @@ +#include +#include + +BleKeyboard bleKeyboard("ESP32 Keyboard"); + +void setup() { + bleKeyboard.begin(); +} + +void loop() { + if (bleKeyboard.isConnected()) { + bleKeyboard.print("Hello"); + } +} From fc7acca9a0a72b489ca79c32f8f50cd745bfeab4 Mon Sep 17 00:00:00 2001 From: Masahiro Tamegai Date: Mon, 24 Mar 2025 08:35:18 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Fix=20folder=20name:=20workflow=20=E2=86=92?= =?UTF-8?q?=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/{workflow => workflows}/build.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflow => workflows}/build.yml (100%) diff --git a/.github/workflow/build.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflow/build.yml rename to .github/workflows/build.yml From a0464837aeaf049df06daca4a0fcf0d59b48609d Mon Sep 17 00:00:00 2001 From: Masahiro Tamegai Date: Mon, 24 Mar 2025 08:39:41 +0900 Subject: [PATCH 3/6] Fix: trigger on master branch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f93e0e..5fb043e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: ESP32 BLE Keyboard CI Build on: push: - branches: [ main ] + branches: [ master ] pull_request: jobs: From 76c31d4a8656aa522cccfe53093615a9d62af209 Mon Sep 17 00:00:00 2001 From: Masahiro Tamegai Date: Mon, 24 Mar 2025 19:15:25 +0900 Subject: [PATCH 4/6] add a badge for the result of CI. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index eac0d4e..7616567 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # ESP32 BLE Keyboard library +![Build](https://github.com/tamegai-m/ESP32-BLE-Keyboard/actions/workflows/build.yml/badge.svg) + +Bluetooth HID Keyboard library for ESP32... + This library allows you to make the ESP32 act as a Bluetooth Keyboard and control what it does. You might also be interested in: - [ESP32-BLE-Mouse](https://github.com/T-vK/ESP32-BLE-Mouse) From 173a7fe5d918bdf51817ecc6f7aaf4189f627e9c Mon Sep 17 00:00:00 2001 From: Masahiro Tamegai Date: Mon, 24 Mar 2025 19:24:41 +0900 Subject: [PATCH 5/6] The badge changed for all repository. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7616567..743a1c2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ESP32 BLE Keyboard library -![Build](https://github.com/tamegai-m/ESP32-BLE-Keyboard/actions/workflows/build.yml/badge.svg) +![Build](https://github.com/${{ github.repository }}/actions/workflows/build.yml/badge.svg) Bluetooth HID Keyboard library for ESP32... From ce985129c8290adeab608d2ce2554cce6856cbfc Mon Sep 17 00:00:00 2001 From: Masahiro Tamegai Date: Mon, 24 Mar 2025 19:37:37 +0900 Subject: [PATCH 6/6] ammend the badge to the README.md file. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 743a1c2..7616567 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ESP32 BLE Keyboard library -![Build](https://github.com/${{ github.repository }}/actions/workflows/build.yml/badge.svg) +![Build](https://github.com/tamegai-m/ESP32-BLE-Keyboard/actions/workflows/build.yml/badge.svg) Bluetooth HID Keyboard library for ESP32...