Skip to content

Commit

Permalink
Merge pull request #176 from nRF24/CMake-4-Linux
Browse files Browse the repository at this point in the history
CMake for Linux
  • Loading branch information
TMRh20 authored Nov 14, 2021
2 parents d9e7909 + 1b0fabe commit 02c46f8
Show file tree
Hide file tree
Showing 112 changed files with 3,779 additions and 2,283 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Arduino CLI build

on:
pull_request:
types: [opened, reopened]
paths:
- ".github/workflows/build_arduino.yml"
- "examples/**"
Expand Down Expand Up @@ -51,7 +52,7 @@ jobs:
- "arduino:avr:ethernet"
- "arduino:avr:fio"
- "arduino:avr:bt"
# - "arduino:avr:LilyPad" # board not found
# - "arduino:avr:LilyPad" # board not found
- "arduino:avr:LilyPadUSB"
- "arduino:avr:pro"
- "arduino:avr:atmegang"
Expand Down
130 changes: 130 additions & 0 deletions .github/workflows/build_platformIO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: PlatformIO build

on:
pull_request:
types: [opened, reopened]
paths:
- ".github/workflows/build_platformIO.yml"
- "library.json"
- "examples/**"
- "!examples/*.zip"
push:
paths:
- ".github/workflows/build_platformIO.yml"
- "library.json"
- "examples/**"
- "!examples/*.zip"
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-RF24Network-${{ steps.latest_ver.outputs.release }}.tar.gz

- name: Save artifact
uses: actions/upload-artifact@v2
with:
name: "PIO_pkg_RF24Network"
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 }}

- name: upload package to PlatformIO Registry
if: github.event_name == 'release' && github.event_type != 'edited'
# PIO lib packages cannot be re-published under the same tag
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
run: pio package publish --owner nrf24 --non-interactive

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/helloworld_rx/helloworld_rx.ino"
- "examples/helloworld_rx_advanced/helloworld_rx_advanced.ino"
- "examples/helloworld_tx/helloworld_tx.ino"
- "examples/helloworld_tx_advanced/helloworld_tx_advanced.ino"
- "examples/Network_Priority_RX/Network_Priority_RX.ino"
- "examples/Network_Priority_TX/Network_Priority_TX.ino"
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.
# 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
- name: Run PlatformIO
run: pio ci --lib="." --board=${{ matrix.board }}
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
105 changes: 105 additions & 0 deletions .github/workflows/build_rp2xxx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Pico SDK build

on:
push:
paths:
- ".github/workflows/build_rp2xxx.yml"
- "*.h"
- "*.cpp"
- "CMakeLists.txt"
- "cmake/"
- "examples_pico/*"
pull_request:
types: [opened, reopened]
paths:
- ".github/workflows/build_rp2xxx.yml"
- "*.h"
- "*.cpp"
- "CMakeLists.txt"
- "cmake/**"
- "examples_pico/*"

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
board:
- "pico"
- "adafruit_feather_rp2040"
- "adafruit_itsybitsy_rp2040"
- "adafruit_qtpy_rp2040"
- "pimoroni_tiny2040" # examples require PicoSDK v1.2.0
- "sparkfun_micromod" # examples require PicoSDK v1.2.0
- "sparkfun_promicro" # examples require PicoSDK v1.2.0
- "sparkfun_thingplus" # examples require PicoSDK v1.2.0
# - "vgaboard" # examples require PicoSDK v1.2.0 (this can be enabled on request)
- "arduino_nano_rp2040_connect" # requires PicoSDK v1.2.0
- "pimoroni_picolipo_4mb" # requires PicoSDK v1.2.0
- "pimoroni_picolipo_16mb" # requires PicoSDK v1.2.0
- "pimoroni_pga2040" # requires PicoSDK v1.2.0
# - "pimoroni_keybow2040" # no SPI bus exposed
# - "pimoroni_picosystem" # SPI is reserved for LCD

steps:
- name: checkout RF24Network lib
uses: actions/checkout@v2
with:
path: RF24Network

- name: checkout RF24 lib
uses: actions/checkout@v2
with:
repository: nRF24/RF24
path: RF24
ref: rp2xxx

- name: Install toolchain
run: sudo apt update && sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential

- name: Clone pico-sdk
uses: actions/checkout@v2
with:
repository: raspberrypi/pico-sdk
# master branch is latest stable release
path: pico-sdk
clean: false
submodules: true

- name: Checkout pico-sdk submodules
working-directory: ${{ github.workspace }}/pico-sdk
run: git submodule update --init

- name: Create Build Environment
working-directory: ${{ github.workspace }}/RF24Network
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
run: cmake -E make_directory ${{ github.workspace }}/RF24Network/build

- name: Configure CMake
working-directory: ${{ github.workspace }}/RF24Network/build
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
run: cmake ../examples_pico -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_BOARD=${{ matrix.board }}

- name: Build
working-directory: ${{ github.workspace }}/RF24Network/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE

- name: Save artifact
uses: actions/upload-artifact@v2
with:
name: examples_pico_${{ matrix.board }}
path: |
${{ github.workspace }}/RF24Network/build/*.uf2
${{ github.workspace }}/RF24Network/build/*.elf
# ${{ github.workspace }}/RF24Network/build/*.hex
# ${{ github.workspace }}/RF24Network/build/*.bin
93 changes: 60 additions & 33 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,71 @@
name: DoxyGen build
name: build Docs

on:
pull_request:
branches:
- master
types: [opened, reopened]
paths:
- "*.h"
- "docs/**"
- "!docs/README.md"
- "*.md"
- "images/**"
- ".github/workflows/doxygen.yml"
- "Doxyfile"
- "library.properties" # get lib version from here
push:
branches:
- master
paths:
- "*.h"
- "docs/**"
- "!docs/README.md"
- "*.md"
- "images/**"
- ".github/workflows/doxygen.yml"
- "Doxyfile"
- "library.properties" # get lib version from here
release:
branches:
- master
types:
- published
- edited
branches: [master]
types: [published, edited]

jobs:
build-doxygen:
runs-on: ubuntu-latest

steps:
- name: get latest release version number
id: latest_ver
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: nRF24/RF24Network
- name: checkout
uses: actions/checkout@v2
- name: overwrite doxygen tags
run: |
touch doxygenAction
echo "PROJECT_NUMBER = ${{ steps.latest_ver.outputs.release }}" >> doxygenAction
echo "@INCLUDE = doxygenAction" >> Doxyfile
- name: build doxygen
uses: mattnotmitt/doxygen-action@v1
with:
working-directory: '.'
doxyfile-path: './Doxyfile'
- name: upload to github pages
if: ${{ github.event_name == 'release'}}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/html
- 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: overwrite doxygen tags
run: |
touch doxygenAction
echo "PROJECT_NUMBER = ${{ steps.latest_ver.outputs.release }}" >> doxygenAction
echo "@INCLUDE = doxygenAction" >> Doxyfile
- name: build doxygen
uses: mattnotmitt/doxygen-action@v1
with:
working-directory: '.'
doxyfile-path: './Doxyfile'
- name: Save doxygen docs as artifact
uses: actions/upload-artifact@v2
with:
name: "RF24Network_doxygen_docs"
path: ${{ github.workspace }}/docs/html
- name: upload to github pages
if: ${{ github.event_name == 'release'}}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/html

# build pretty docs using doxygen XML output with Sphinx
- uses: actions/setup-python@v2
- name: Install sphinx deps
run: python -m pip install -r docs/sphinx/requirements.txt
- name: build docs with Sphinx
working-directory: docs
run: sphinx-build sphinx _build
- name: Save sphinx docs as artifact
uses: actions/upload-artifact@v2
with:
name: "RF24Network_sphinx_docs"
path: ${{ github.workspace }}/docs/_build
Loading

0 comments on commit 02c46f8

Please sign in to comment.