-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fmt examples & add CI for arduino and PIO
- Loading branch information
Showing
25 changed files
with
2,143 additions
and
1,799 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: Arduino CLI build | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
paths: | ||
- ".github/workflows/build_arduino.yml" | ||
- "examples/**" | ||
|
||
push: | ||
paths: | ||
- ".github/workflows/build_arduino.yml" | ||
- "examples/**" | ||
|
||
jobs: | ||
check_formatting: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Check code formatting | ||
uses: per1234/artistic-style-action@main | ||
with: | ||
options-file-path: ./examples/examples_formatter.conf | ||
name-patterns: | | ||
- '*.ino' | ||
- '*.cpp' | ||
- '*.hpp' | ||
- '*.h' | ||
target-paths: | | ||
- examples | ||
build: | ||
needs: check_formatting | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
fqbn: | ||
- "arduino:avr:yun" | ||
- "arduino:avr:uno" | ||
- "arduino:avr:diecimila" | ||
- "arduino:avr:nano" | ||
- "arduino:avr:mega" | ||
- "arduino:avr:megaADK" | ||
- "arduino:avr:leonardo" | ||
- "arduino:avr:micro" | ||
- "arduino:avr:esplora" | ||
- "arduino:avr:mini" | ||
- "arduino:avr:ethernet" | ||
- "arduino:avr:fio" | ||
- "arduino:avr:bt" | ||
# - "arduino:avr:LilyPad" # board not found | ||
- "arduino:avr:LilyPadUSB" | ||
- "arduino:avr:pro" | ||
- "arduino:avr:atmegang" | ||
- "arduino:avr:robotControl" | ||
# - "arduino:avr:gemma" # does not support SPI | ||
- "arduino:avr:circuitplay32u4cat" | ||
- "arduino:avr:yunmini" | ||
- "arduino:avr:chiwawa" | ||
- "arduino:avr:one" | ||
- "arduino:avr:unowifi" | ||
- "arduino:mbed:nano33ble" | ||
- "arduino:samd:mkr1000" | ||
- "arduino:samd:mkrzero" | ||
- "arduino:samd:mkrwifi1010" | ||
- "arduino:samd:nano_33_iot" | ||
- "arduino:samd:mkrfox1200" | ||
- "arduino:samd:mkrwan1300" | ||
- "arduino:samd:mkrwan1310" | ||
- "arduino:samd:mkrgsm1400" | ||
- "arduino:samd:mkrnb1500" | ||
- "arduino:samd:mkrvidor4000" | ||
- "arduino:samd:adafruit_circuitplayground_m0" | ||
- "arduino:samd:mzero_pro_bl" | ||
- "arduino:samd:mzero_bl" | ||
- "arduino:samd:tian" | ||
- "arduino:megaavr:uno2018" | ||
# - "arduino:megaavr:nano4809" # board not found | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Compile examples | ||
uses: arduino/compile-sketches@main | ||
with: | ||
sketch-paths: | | ||
- examples/Getting_Started_SimpleClient_Mesh | ||
- examples/Getting_Started_SimpleServer_Mesh | ||
- examples/InteractiveServer_Mesh | ||
- examples/MQTT/mqtt_basic | ||
- examples/MQTT/mqtt_basic_2 | ||
- examples/SimpleClient_Mesh | ||
- examples/SLIP_Gateway | ||
- examples/SLIP_InteractiveServer | ||
- examples/TAP/Getting_Started_InteractiveServer | ||
- examples/TAP/Getting_Started_SimpleClient | ||
- examples/TAP/Getting_Started_SimpleClient_DNS | ||
- examples/TAP/Getting_Started_SimpleServer | ||
- examples/TAP/Getting_Started_SimpleServer_Minimal | ||
# - examples/TAP/InteractiveServer # specific to AVR boards | ||
# - examples/InteractiveServer_Mesh_ESPWifi # needs ESP8266WiFi.h | ||
libraries: | | ||
- name: RF24 | ||
- name: RF24Mesh | ||
- name: RF24Network | ||
- name: PubSubClient | ||
- name: MQTT | ||
- source-path: ./ | ||
# - source-url: https://github.com/nRF24/RF24Network.git | ||
# version: CMake-4-Linux | ||
# - source-url: https://github.com/nRF24/RF24Mesh.git | ||
# version: CMake-4-Linux | ||
fqbn: ${{ matrix.fqbn }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: PlatformIO build | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
paths: | ||
- ".github/workflows/build_platformIO.yml" | ||
- "library.json" | ||
- "examples/**" | ||
- "!examples/old_backups/**" | ||
- "!examples/rf24_ATTiny/**" | ||
push: | ||
paths: | ||
- ".github/workflows/build_platformIO.yml" | ||
- "library.json" | ||
- "examples/**" | ||
- "!examples/old_backups/**" | ||
- "!examples/rf24_ATTiny/**" | ||
release: | ||
types: [published, edited] | ||
|
||
jobs: | ||
validate_lib_json: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: get latest release version number | ||
id: latest_ver | ||
run: echo "::set-output name=release::$(awk -F "=" '/version/ {print $2}' library.properties)" | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade platformio | ||
- name: package lib | ||
run: pio package pack -o PlatformIO-RF24Mesh-${{ steps.latest_ver.outputs.release }}.tar.gz | ||
|
||
- name: Save artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: "PIO_pkg_RF24Mesh" | ||
path: PlatformIO*.tar.gz | ||
|
||
- name: Upload Release assets | ||
if: github.event_name == 'release' | ||
uses: csexton/release-asset-action@master | ||
with: | ||
pattern: "PlatformIO*.tar.gz" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
check_formatting: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Check code formatting | ||
uses: per1234/artistic-style-action@main | ||
with: | ||
options-file-path: ./examples/examples_formatter.conf | ||
name-patterns: | | ||
- '*.ino' | ||
- '*.cpp' | ||
- '*.hpp' | ||
- '*.h' | ||
target-paths: | | ||
- examples | ||
build: | ||
needs: [check_formatting, validate_lib_json] | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
example: | ||
- "examples/Getting_Started_SimpleClient_Mesh/Getting_Started_SimpleClient_Mesh.ino" | ||
- "examples/Getting_Started_SimpleServer_Mesh/Getting_Started_SimpleServer_Mesh.ino" | ||
- "examples/InteractiveServer_Mesh/InteractiveServer_Mesh.ino" | ||
- "examples/MQTT/mqtt_basic/mqtt_basic.ino" | ||
- "examples/MQTT/mqtt_basic_2/mqtt_basic_2.ino" | ||
- "examples/SimpleClient_Mesh/SimpleClient_Mesh.ino" | ||
- "examples/SLIP_Gateway/SLIP_Gateway.ino" | ||
- "examples/SLIP_InteractiveServer/SLIP_InteractiveServer.ino" | ||
- "examples/TAP/Getting_Started_InteractiveServer/Getting_Started_InteractiveServer.ino" | ||
- "examples/TAP/Getting_Started_SimpleClient/Getting_Started_SimpleClient.ino" | ||
- "examples/TAP/Getting_Started_SimpleClient_DNS/Getting_Started_SimpleClient_DNS.ino" | ||
- "examples/TAP/Getting_Started_SimpleServer/Getting_Started_SimpleServer.ino" | ||
- "examples/TAP/Getting_Started_SimpleServer_Minimal/Getting_Started_SimpleServer_Minimal.ino" | ||
# - "examples/TAP/InteractiveServer/InteractiveServer.ino" # specific to AVR boards | ||
# - "examples/InteractiveServer_Mesh_ESPWifi/InteractiveServer_Mesh_ESPWifi.ino" # requires ESP8266WiFi.h | ||
board: | ||
- "teensy31" | ||
- "teensy35" | ||
- "teensy36" | ||
- "teensy40" | ||
- "teensy41" | ||
- "teensylc" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.platformio | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade platformio | ||
# "dependencies" field in JSON should automatically install RF24 & RF24Network. | ||
# Because we run this CI test against the local repo, the JSON seems neglected | ||
- name: Install library dependencies | ||
run: | | ||
pio lib -g install nrf24/RF24 | ||
pio lib -g install nrf24/RF24Network | ||
pio lib -g install nrf24/RF24Mesh | ||
pio lib -g install knolleary/PubSubClient | ||
pio lib -g install 256dpi/MQTT | ||
- name: Run PlatformIO | ||
run: pio ci --lib="." --board=${{ matrix.board }} | ||
env: | ||
PLATFORMIO_CI_SRC: ${{ matrix.example }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,6 @@ Temporary Items | |
# ignore docs folder | ||
docs/html/ | ||
docs/xml/ | ||
|
||
# AStyle formatter bakup files | ||
*.orig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.