diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5fb043e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: ESP32 BLE Keyboard CI Build + +on: + push: + branches: [ master ] + 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/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) 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"); + } +}