Skip to content

Commit

Permalink
Doc updates and reusable CI (#217)
Browse files Browse the repository at this point in the history
* various doc updates

- include ToC in Doxygen pages output
- refactor Doxyfile path
- updated CSS

* make all CI reusable workflow callers
  • Loading branch information
2bndy5 authored Jan 22, 2023
1 parent 03e73fb commit 780fa08
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 1,384 deletions.
101 changes: 28 additions & 73 deletions .github/workflows/build_arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,39 @@ on:
- ".github/workflows/build_arduino.yml"
- "examples/**"

env:
# convenient variable used multiple times
SKETCHES_REPORTS: sketches-reports

jobs:
check_formatting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
# Ubuntu 20.04.4 LTS reunners ship with clang-tools v12
# - name: Install clang-tools
# uses: KyleMayes/install-llvm-action@v1
# with:
# version: 12
- name: Install linter python package
run: python3 -m pip install git+https://github.com/cpp-linter/cpp-linter-action@v1
- name: run linter as a python package
id: linter
run: |
cpp-linter \
--version=12 \
--style=file \
--tidy-checks='-*' \
--files-changed-only='False' \
--extensions=ino
- name: Linter checks failed?
if: steps.linter.outputs.checks-failed > 0
run: exit 1
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: '!examples|'
extensions: ino

build:
needs: check_formatting
runs-on: ubuntu-latest

uses: nRF24/.github/.github/workflows/build_arduino.yaml@main
with:
sketch-paths: |
- examples/RF24Mesh_Example
- examples/RF24Mesh_Example_Master_Statics
- examples/RF24Mesh_Example_Master_To_Nodes
- examples/RF24Mesh_Example_Node2Node
- examples/RF24Mesh_Example_Node2NodeExtra
- examples/RF24Mesh_SerialConfig
- examples/RF24Mesh_Example_Master
libraries: |
- source-url: https://github.com/nRF24/RF24.git
- source-url: https://github.com/nRF24/RF24Network.git
- source-path: ./
fqbn: ${{ matrix.fqbn }}
enable-deltas-report: ${{ matrix.enable-deltas-report }}
platforms: |
- name: arduino:avr
- name: arduino:megaavr
- name: arduino:samd
- name: arduino:mbed
# - name: arduino:sam
strategy:
fail-fast: false

matrix:
fqbn:
- "arduino:avr:yun"
Expand All @@ -75,7 +70,7 @@ jobs:
- "arduino:avr:chiwawa"
- "arduino:avr:one"
- "arduino:avr:unowifi"
- "arduino:mbed:nano33ble"
# - "arduino:mbed:nano33ble" # pending nRF5x integration
- "arduino:samd:mkr1000"
- "arduino:samd:mkrwifi1010"
- "arduino:samd:nano_33_iot"
Expand All @@ -101,48 +96,8 @@ jobs:
- fqbn: arduino:samd:mkrzero
enable-deltas-report: true

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile examples
uses: arduino/compile-sketches@main
with:
sketch-paths: |
- examples/RF24Mesh_Example
- examples/RF24Mesh_Example_Master_Statics
- examples/RF24Mesh_Example_Master_To_Nodes
- examples/RF24Mesh_Example_Node2Node
- examples/RF24Mesh_Example_Node2NodeExtra
- examples/RF24Mesh_SerialConfig
- examples/RF24Mesh_Example_Master
libraries: |
- name: RF24
- source-url: https://github.com/nRF24/RF24Network.git
- source-path: ./
# - name: RF24Network
fqbn: ${{ matrix.fqbn }}
enable-deltas-report: ${{ matrix.enable-deltas-report }}
sketches-report-path: ${{ env.SKETCHES_REPORTS }}
# This step is needed to pass the size data to the report job
- name: Upload sketches report to workflow artifact
if: ${{ matrix.enable-deltas-report }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS }}
path: ${{ env.SKETCHES_REPORTS }}

# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
report:
needs: [build]
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Download sketches reports artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS }}
path: ${{ env.SKETCHES_REPORTS }}

- uses: arduino/report-size-deltas@v1
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS }}
uses: nRF24/.github/.github/workflows/arduino_size_deltas.yaml@main
174 changes: 11 additions & 163 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,22 @@ env:

jobs:
check_formatting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
# Ubuntu 20.04.4 LTS reunners ship with clang-tools v12
# - name: Install clang-tools
# uses: KyleMayes/install-llvm-action@v1
# with:
# version: 12
- name: Install linter python package
run: python3 -m pip install git+https://github.com/cpp-linter/cpp-linter-action@v1
- name: run linter as a python package
id: linter
run: |
cpp-linter \
--version=12 \
--style=file \
--tidy-checks='-*' \
--files-changed-only='False' \
--ignore='examples|examples_pico'
- name: Linter checks failed?
if: steps.linter.outputs.checks-failed > 0
run: exit 1
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: 'examples|examples_pico'

using_cmake:
needs: check_formatting
runs-on: ubuntu-latest

uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main
with:
rf24mesh-ref: ${{ github.sha }}
compiler: ${{ matrix.toolchain.compiler }}
usr-dir: ${{ matrix.toolchain.usr_dir }}
examples-path: examples_RPi
deploy-release: ${{ github.event_name == 'release' && (matrix.toolchain.compiler == 'armhf' || matrix.toolchain.compiler == 'arm64') }}
py-wrapper-path: pyRF24Mesh
strategy:
fail-fast: false

matrix:
toolchain:
- compiler: "armhf"
Expand All @@ -79,139 +63,3 @@ jobs:
# usr_dir: "i686-linux-gnu"
- compiler: "default" # github runner is hosted on a "amd64"
usr_dir: "local"

steps:
# - name: provide toolchain (for x86_64)
# if: ${{ matrix.toolchain.compiler == 'x86_64' }}
# run: |
# sudo apt-get update
# sudo apt-get install gcc-x86-64-linux-gnux32 g++-x86-64-linux-gnux32

# - name: provide toolchain (for i686)
# if: ${{ matrix.toolchain.compiler == 'i686' }}
# run: |
# sudo apt-get update
# sudo apt-get install gcc-i686-linux-gnu g++-i686-linux-gnu

- name: provide toolchain (for arm64)
if: ${{ matrix.toolchain.compiler == 'arm64' }}
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: provide toolchain (for armhf)
if: ${{ matrix.toolchain.compiler == 'armhf' }}
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
- name: checkout RF24
uses: actions/checkout@v2
with:
repository: nRF24/RF24

- name: build & install RF24
run: |
mkdir build
cd build
cmake .. -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D RF24_DRIVER=SPIDEV \
-D CMAKE_INSTALL_PREFIX=/usr/${{ matrix.toolchain.usr_dir }} \
-D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/${{ matrix.toolchain.compiler }}.cmake
sudo make install
- name: checkout RF24Network
uses: actions/checkout@v2
with:
repository: nRF24/RF24Network

- name: build & install RF24Network
run: |
mkdir build
cd build
cmake .. -D CMAKE_BUILD_TYPE=$BUILD_TYPE \
-D CMAKE_INSTALL_PREFIX=/usr/${{ matrix.toolchain.usr_dir }} \
-D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/${{ matrix.toolchain.compiler }}.cmake
sudo make install
- name: checkout RF24Mesh repo
uses: actions/checkout@v2

- name: create CMake build environment
run: cmake -E make_directory ${{ github.workspace }}/build

- name: configure lib
working-directory: ${{ github.workspace }}/build
run: |
cmake .. -D CMAKE_BUILD_TYPE=$BUILD_TYPE \
-D CMAKE_INSTALL_PREFIX=/usr/${{ matrix.toolchain.usr_dir }} \
-D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/${{ matrix.toolchain.compiler }}.cmake
- name: build lib
working-directory: ${{ github.workspace }}/build
run: cmake --build .

- name: install lib
working-directory: ${{ github.workspace }}/build
run: sudo cmake --install .

- name: package lib
working-directory: ${{ github.workspace }}/build
run: sudo cpack

- name: Save artifact
uses: actions/upload-artifact@v2
with:
name: "pkg_RF24Mesh"
path: |
${{ github.workspace }}/build/pkgs/*.deb
${{ github.workspace }}/build/pkgs/*.rpm
- name: Upload Release assets
if: github.event_name == 'release' && (matrix.toolchain.compiler == 'armhf' || matrix.toolchain.compiler == 'arm64')
uses: csexton/release-asset-action@master
with:
pattern: "${{ github.workspace }}/build/pkgs/librf24*"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: clean build environment
working-directory: ${{ github.workspace }}/build
run: sudo rm -r ./*

- name: configure examples
working-directory: ${{ github.workspace }}/build
run: |
cmake ../examples_RPi \
-D CMAKE_TOOLCHAIN_FILE=../cmake/toolchains/${{ matrix.toolchain.compiler }}.cmake
- name: build examples
working-directory: ${{ github.workspace }}/build
# doesn't build the RF24Mesh_Ncurses_Master example because we haven't cross-compiled it in this workflow
run: |
cmake --build .
file ./RF24Mesh_Example
# cross-compiling a python C extension is better done with pypa/cibuildwheel action
- name: Set up Python 3.7
if: ${{ matrix.toolchain.compiler == 'default' }}
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: provide python wrapper prerequisites
if: ${{ matrix.toolchain.compiler == 'default' }}
# python3-rpi.gpio is only required for physical hardware (namely the IRQ example)
run: sudo apt-get install python3-dev libboost-python-dev python3-setuptools

- name: create alias symlink to libboost_python3*.so
if: ${{ matrix.toolchain.compiler == 'default' }}
run: sudo ln -s $(ls /usr/lib/$(ls /usr/lib/gcc | tail -1)/libboost_python3*.so | tail -1) /usr/lib/$(ls /usr/lib/gcc | tail -1)/libboost_python3.so

- name: build python wrapper
if: ${{ matrix.toolchain.compiler == 'default' }}
working-directory: ${{ github.workspace }}/pyRF24Mesh
run: python3 setup.py build

- name: install python wrapper
if: ${{ matrix.toolchain.compiler == 'default' }}
working-directory: ${{ github.workspace }}/pyRF24Mesh
run: sudo python3 setup.py install
Loading

0 comments on commit 780fa08

Please sign in to comment.