initial commit
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
name: Build with Arduino
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
paths:
|
||||
- "src/**"
|
||||
- "examples/**"
|
||||
- ".github/workflows/arduino_ci.yml"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
ArduinoLint:
|
||||
name: ${{ matrix.board.fqbn }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
board:
|
||||
- fqbn: esp32:esp32:esp32s3
|
||||
platform: esp32:esp32
|
||||
url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
|
||||
- fqbn: rp2040:rp2040:rpipico
|
||||
platform: rp2040:rp2040
|
||||
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
|
||||
- fqbn: adafruit:nrf52:pca10056
|
||||
platform: adafruit:nrf52
|
||||
url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
|
||||
- fqbn: STMicroelectronics:stm32:GenF4
|
||||
platform: stmicroelectronics:stm32
|
||||
url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
|
||||
- fqbn: arduino:mbed_rp2040:pico
|
||||
platform: arduino:mbed_rp2040
|
||||
include:
|
||||
- example_file: examples.txt
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Arduino CLI
|
||||
run: |
|
||||
echo "Installing Arduino CLI..."
|
||||
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to install Arduino CLI."
|
||||
exit 1
|
||||
fi
|
||||
echo "./bin" >> $GITHUB_PATH
|
||||
echo "Arduino CLI installed successfully."
|
||||
|
||||
- name: Install board
|
||||
run: |
|
||||
echo "Initializing Arduino CLI configuration..."
|
||||
arduino-cli config init
|
||||
arduino-cli config set library.enable_unsafe_install true
|
||||
if [ -n "${{ matrix.board.url }}" ]; then
|
||||
echo "Adding additional board manager URL: ${{ matrix.board.url }}"
|
||||
arduino-cli config add board_manager.additional_urls ${{ matrix.board.url }}
|
||||
fi
|
||||
echo "Updating board index..."
|
||||
arduino-cli core update-index
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to update board index."
|
||||
exit 1
|
||||
fi
|
||||
echo "Installing board platform: ${{ matrix.board.platform }}"
|
||||
arduino-cli core install ${{ matrix.board.platform }}
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to install board platform."
|
||||
exit 1
|
||||
fi
|
||||
echo "Board platform installed successfully."
|
||||
|
||||
- name: Install libraries
|
||||
run: |
|
||||
echo "Installing required libraries..."
|
||||
arduino-cli lib install --git-url https://github.com/ThingPulse/esp8266-oled-ssd1306.git
|
||||
arduino-cli lib install --git-url https://github.com/arduino-libraries/MadgwickAHRS.git
|
||||
arduino-cli lib install --git-url https://github.com/CreativeRobotics/Commander.git
|
||||
arduino-cli lib install --git-url https://github.com/adafruit/SdFat.git
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to install libraries."
|
||||
exit 1
|
||||
fi
|
||||
echo "Libraries installed successfully."
|
||||
|
||||
- name: Install adafruit-nrfutil
|
||||
if: matrix.board.platform == 'adafruit:nrf52'
|
||||
run: |
|
||||
pip install adafruit-nrfutil
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to install adafruit-nrfutil."
|
||||
exit 1
|
||||
fi
|
||||
echo "adafruit-nrfutil installed successfully."
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Find .ino files in examples directory
|
||||
id: find-examples
|
||||
run: |
|
||||
echo "Current working directory: $(pwd)"
|
||||
if [ -d "./examples" ]; then
|
||||
examples=$(find ./examples -name "*.ino" -print0 | tr '\0' ' ')
|
||||
echo "Found examples: $examples"
|
||||
echo "examples=$examples" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "The './examples' directory does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Run test
|
||||
run: |
|
||||
for example in ${{ steps.find-examples.outputs.examples }}; do
|
||||
echo "Compiling example: $example"
|
||||
arduino-cli compile --library . -b ${{ matrix.board.fqbn }} $example
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Compilation failed for example: $example"
|
||||
exit 1
|
||||
fi
|
||||
echo "Compilation succeeded for example: $example"
|
||||
done
|
||||
@@ -0,0 +1,38 @@
|
||||
name: Build with ESP-IDF
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
paths:
|
||||
- "src/**"
|
||||
- "examples/ESP_IDF_TouchDrvExample/**"
|
||||
- "examples/ESP_IDF_SensorExamples/**"
|
||||
- ".github/workflows/esp-idf.yml"
|
||||
|
||||
jobs:
|
||||
esp-idf-build:
|
||||
strategy:
|
||||
matrix:
|
||||
idf_ver: ["latest"]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container: espressif/idf:${{ matrix.idf_ver }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: "recursive"
|
||||
- name: Build ESP_IDF_TouchDrvExample
|
||||
shell: bash
|
||||
run: |
|
||||
pwd
|
||||
. ${IDF_PATH}/export.sh
|
||||
cd examples/ESP_IDF_TouchDrvExample
|
||||
idf.py build
|
||||
- name: Build ESP_IDF_SensorExamples
|
||||
shell: bash
|
||||
run: |
|
||||
pwd
|
||||
. ${IDF_PATH}/export.sh
|
||||
cd examples/ESP_IDF_SensorExamples
|
||||
idf.py build
|
||||
@@ -0,0 +1,80 @@
|
||||
name: Build with PlatformIO
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
paths:
|
||||
- "src/**"
|
||||
- "examples/**"
|
||||
- ".github/workflows/platformio.yml"
|
||||
- "platformio.ini"
|
||||
|
||||
jobs:
|
||||
platformio-build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
example: ${{ fromJSON(needs.find-examples.outputs.examples) }}
|
||||
needs: [find-examples]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cache/pip
|
||||
~/.platformio/.cache
|
||||
key: ${{ runner.os }}-pio
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- name: Install PlatformIO Core
|
||||
run: pip install --upgrade platformio
|
||||
|
||||
- name: Install MadgwickAHRS library
|
||||
run: pio pkg install --library "arduino-libraries/Madgwick@^1.2.0" -g
|
||||
|
||||
- name: Install esp8266-oled-ssd1306 library
|
||||
run: pio pkg install --library "thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays @ ^4.4.0" -g
|
||||
|
||||
- name: Install Commander library
|
||||
run: pio pkg install --library "creativerobotics/Commander @ ^4.3.0" -g
|
||||
|
||||
- name: Install SdFat
|
||||
run: pio pkg install --library "adafruit/SdFat - Adafruit Fork @ ^2.2.3" -g
|
||||
|
||||
- name: Run PlatformIO
|
||||
run: pio ci --lib="." --board=esp32-s3-devkitm-1 --board=nrf52840_dk_adafruit
|
||||
env:
|
||||
PLATFORMIO_CI_SRC: ${{ matrix.example }}
|
||||
|
||||
find-examples:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
examples: ${{ steps.find.outputs.examples }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Create Python script
|
||||
run: |
|
||||
cat << 'EOF' > find_examples.py
|
||||
import os
|
||||
import json
|
||||
|
||||
examples_dir = 'examples'
|
||||
ino_folders = []
|
||||
|
||||
for root, dirs, files in os.walk(examples_dir):
|
||||
for file in files:
|
||||
if file.endswith('.ino'):
|
||||
ino_folders.append(root)
|
||||
break
|
||||
|
||||
unique_folders = sorted(set(ino_folders))
|
||||
print(json.dumps(unique_folders))
|
||||
EOF
|
||||
- name: Run Python script
|
||||
id: find
|
||||
run: |
|
||||
result=$(python find_examples.py)
|
||||
echo "::set-output name=examples::$result"
|
||||
Reference in New Issue
Block a user