Skip to content

Formatting

Formatting #746

Workflow file for this run

name: Linux build
on:
pull_request_target:
pull_request:
types: [opened, reopened]
paths:
- "*.h"
- "*.cpp"
- "CMakeLists.txt"
- "cmake/**"
- "library.properties" # CMake & 'configure' gets lib info from here
- "configure"
- "Makefile"
- "utility/CMakeLists.txt"
# - "utility/LittleWire/*"" # this is not tested (anymore)
- "utility/wiringPi/*"
- "utility/MRAAA/*"
- "utility/SPIDEV/*"
- "utility/pigpio"
- "examples_linux/*"
- "!examples_linux/*.py"
- "!examples_linux/*.md"
- "pyRF24/setup.py"
- "pyRF24/pyRF24.cpp"
- ".github/workflows/build_linux.yml"
push:
paths:
- "*.h"
- "*.cpp"
- "CMakeLists.txt"
- "cmake/**"
- "library.properties" # CMake & 'configure' gets lib info from here
- "configure"
- "Makefile"
- "utility/CMakeLists.txt"
# - "utility/LittleWire/*"" # this is not tested (anymore)
- "utility/wiringPi/*"
- "utility/MRAAA/*"
- "utility/SPIDEV/*"
- "utility/pigpio"
- "examples_linux/*"
- "!examples_linux/*.py"
- "!examples_linux/*.md"
- "pyRF24/setup.py"
- "pyRF24/pyRF24.cpp"
- ".github/workflows/build_linux.yml"
release:
types: [created]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
check_formatting:
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: 'examples|examples_pico|utility/RPi/bcm2835.h|utility/RPi/bcm2835.c'
####################### using Makefile #############################
build:
needs: check_formatting
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config-options:
- "--soc=BCM2835 --driver=RPi"
- "--soc=BCM2836 --driver=RPi"
- "--driver=SPIDEV"
- "--driver=MRAA"
- "--driver=pigpio"
# - "--soc=BCM2835 --driver=wiringPi"
env:
CFLAGS: "-I /usr/local/include"
steps:
- uses: actions/checkout@v3
- name: provide toolchain
run: |
sudo apt-get update
sudo apt-get install binutils-arm-linux-gnueabi gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
arm-linux-gnueabihf-gcc -v
arm-linux-gnueabihf-g++ -v
- name: provide WiringPi
if: ${{ matrix.config-options == '--soc=BCM2835 --driver=wiringPi' }}
env:
CC: /usr/bin/arm-linux-gnueabihf-gcc
CFLAGS: "-I /usr/local/include -L /usr/local/lib -marm -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -lcrypt -lrt"
run: |
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
./build
- name: provide pigpio
if: ${{ matrix.config-options == '--driver=pigpio' || endsWith(matrix.config-options, '--driver=RPi') }}
run: |
git clone https://github.com/joan2937/pigpio.git
cd pigpio
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
mkdir build
cd build
cmake .. -D CMAKE_INSTALL_PREFIX=/usr/arm-linux-gnueabihf \
-D CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/cmake/toolchains/armhf.cmake
make
sudo make install
- name: provide MRAA
if: ${{ matrix.config-options == '--driver=MRAA' }}
env:
CC: /usr/bin/arm-linux-gnueabihf-gcc
CXX: /usr/bin/arm-linux-gnueabihf-g++
run: |
git clone https://github.com/intel-iot-devkit/mraa.git
cd mraa
mkdir build
cd build
cmake .. -D BUILDSWIGNODE=OFF -D BUILDARCH=arm
sudo make install
sudo bash -c 'echo "/usr/local/lib/arm-linux-gnueabihf" >> /etc/ld.so.conf'
sudo ldconfig
- name: library configure
run: ./configure ${{ matrix.config-options }}
- name: library make
run: make
- name: library make install
run: sudo make install
- name: make linux examples
# compiling examples for wiringPi is broken see issue #669
# executables linked to wiringPi additionally need to be linked to crypt and shm_open
# interruptConfigure.cpp example is incompatible with MRAA & wiringPi drivers
if: ${{ matrix.config-options != '--soc=BCM2835 --driver=wiringPi' && matrix.config-options != '--driver=MRAA' }}
run: |
cd examples_linux
make
file ./gettingstarted
####################### using CMake ################################
using_cmake:
needs: check_formatting
uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main
with:
rf24-ref: ${{ github.sha }}
driver: ${{ matrix.driver }}
compiler: ${{ matrix.toolchain.compiler }}
usr-dir: ${{ matrix.toolchain.usr_dir }}
examples-path: examples_linux
deploy-release: ${{ github.event_name == 'release' && (matrix.toolchain.compiler == 'armhf' || matrix.toolchain.compiler == 'arm64') && (matrix.driver =='RPi' || matrix.driver =='SPIDEV') }}
py-wrapper-path: pyRF24
strategy:
fail-fast: false
matrix:
toolchain:
- compiler: "armhf"
usr_dir: "arm-linux-gnueabihf"
- compiler: "arm64"
usr_dir: "aarch64-linux-gnu"
# - compiler: "x86_64"
# usr_dir: "x86_64-linux-gnux32"
# - compiler: "i686"
# usr_dir: "i686-linux-gnu"
- compiler: "default" # github runner is hosted on a "amd64"
usr_dir: "local" # using this toolchain to test python wrapper
driver:
- "RPi"
- "SPIDEV"
- "MRAA"
- "pigpio"
exclude:
# MRAA is not compatible with i686 arch
- driver: "MRAA"
toolchain:
compiler: "i686"
usr_dir: "i686-linux-gnu"
- driver: "pigpio"
toolchain:
compiler: "default"
usr_dir: "local"
include:
# need to cross-compile wiringPi dependencies (libcrypt)
# only test default compiler with wiringPi
- driver: "wiringPi"
toolchain:
compiler: "default" # github runner is hosted on a "amd64"
usr_dir: "local"