Skip to content

chore(dev): revise CI #996

chore(dev): revise CI

chore(dev): revise CI #996

Workflow file for this run

name: Linux
on:
pull_request:
branches: [master]
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:
branches: [master]
tags: ["*"]
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"
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
####################### using Makefile #############################
build:
name: using legacy makefiles
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"
# disable wiringPi due to needing cross-compiled deps (see comment below)
# - "--soc=BCM2835 --driver=wiringPi"
env:
# this env var is supported as of CMake v3.29+
CMAKE_INSTALL_PREFIX: /usr/arm-linux-gnueabihf
# this env var is supported as of CMake v3.21+
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/cmake/toolchains/armhf.cmake
CFLAGS: "-I /usr/local/include"
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- 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
# NOTE: To cross-compile wiringPi, there needs to be cross-compiled `crypt` and `rt` libs
# Skip cross-compiling wiringPi to avoid this headache.
# - 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' }}
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 ..
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
env:
CONFIG_OPTIONS: ${{ matrix.config-options }}
run: ./configure ${CONFIG_OPTIONS}
- name: library make
run: make
- name: library make install
run: sudo make install
- name: make linux examples
run: |-
cd examples_linux
make
file ./gettingstarted
####################### using CMake ################################
build-cmake:
name: using CMake
uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@review-ci
with:
rf24-ref: ${{ github.sha }}
driver: ${{ matrix.driver }}
compiler: ${{ matrix.toolchain.compiler }}
usr-dir: ${{ matrix.toolchain.usr_dir }}
examples-path: examples_linux
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"
deploy:
name: deploy release assets
needs: [build-cmake]
permissions:
# needed for uploading release assets
contents: write
if: startsWith(github.ref, 'refs/tags/')
uses: nRF24/.github/.github/workflows/deploy_cpack_artifacts.yaml@review-ci
secrets: inherit