Interrupt support #168
This file contains hidden or 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
name: Linux | |
on: | |
pull_request: | |
branches: [master] | |
paths: | |
- "library.properties" # CMake gets lib info from here | |
- "src/*.h" | |
- "src/*.cpp" | |
- "!src/py_bindings.cpp" | |
- "src/CMakeLists.txt" | |
- "src/cmake/**" | |
- "src/utility/CMakeLists.txt" | |
- "src/utility/mraa/*" | |
- "src/utility/linux_kernel/*" | |
- "src/utility/pigpio/*" | |
- "src/utility/bcm2xxx/*" | |
- "examples/linux/*" | |
- ".github/workflows/build_linux.yml" | |
push: | |
branches: [master] | |
paths: | |
- "library.properties" # CMake gets lib info from here | |
- "src/*.h" | |
- "src/*.cpp" | |
- "!src/py_bindings.cpp" | |
- "src/CMakeLists.txt" | |
- "src/cmake/**" | |
- "src/utility/CMakeLists.txt" | |
- "src/utility/mraa/*" | |
- "src/utility/linux_kernel/*" | |
- "src/utility/pigpio/*" | |
- "src/utility/bcm2xxx/*" | |
- "examples/linux/*" | |
- ".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: ./.github/workflows/cpp_lint.yaml | |
with: | |
ignore: 'examples|!examples/linux|src/utility/bcm2xxx/bcm2835.h|src/utility/bcm2xxx/bcm2835.c|src/linux' | |
build: | |
needs: check_formatting | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- compiler: "armhf" | |
usr_dir: "arm-linux-gnueabihf" | |
- compiler: "arm64" | |
usr_dir: "aarch64-linux-gnu" | |
- compiler: "default" # github runner is hosted on a "amd64" | |
usr_dir: "local" # using this toolchain to test python wrapper | |
i2c-bus: [-DUSE_I2C=ON, -DUSE_I2C=OFF] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
steps: | |
- 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 | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{ github.event.repository.name }} | |
- name: create CMake build environment | |
run: cmake -E make_directory ${{ github.workspace }}/${{ github.event.repository.name }}/build | |
- name: configure lib | |
working-directory: ${{ github.workspace }}/${{ github.event.repository.name }}/build | |
run: | | |
cmake ../src -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 }}/${{ github.event.repository.name }}/build | |
run: cmake --build . | |
- name: install lib | |
working-directory: ${{ github.workspace }}/${{ github.event.repository.name }}/build | |
run: sudo cmake --install . | |
- name: package lib | |
if: endsWith(matrix.i2c-bus, 'OFF') | |
working-directory: ${{ github.workspace }}/${{ github.event.repository.name }}/build | |
run: sudo cpack | |
- name: Save artifact | |
if: endsWith(matrix.i2c-bus, 'OFF') && startsWith(matrix.toolchain.compiler, 'arm') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pkg_${{ github.event.repository.name }}_linux_kernel_${{ matrix.toolchain.compiler }} | |
path: | | |
${{ github.workspace }}/${{ github.event.repository.name }}/build/pkgs/*.deb | |
${{ github.workspace }}/${{ github.event.repository.name }}/build/pkgs/*.rpm | |
- name: Upload Release assets | |
if: github.event_name == 'release' && (matrix.toolchain.compiler == 'armhf' || matrix.toolchain.compiler == 'arm64') && endsWith(matrix.i2c-bus, 'OFF') | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: "${{ github.workspace }}/${{ github.event.repository.name }}/build/pkgs/lib*" | |
- name: clean build environment | |
working-directory: ${{ github.workspace }}/${{ github.event.repository.name }}/build | |
run: sudo rm -r ./* | |
- name: configure examples | |
working-directory: ${{ github.workspace }}/${{ github.event.repository.name }}/build | |
run: | | |
cmake ../examples/linux \ | |
-D CMAKE_TOOLCHAIN_FILE=../src/cmake/toolchains/${{ matrix.toolchain.compiler }}.cmake \ | |
${{ matrix.i2c-bus }} | |
- name: build examples | |
working-directory: ${{ github.workspace }}/${{ github.event.repository.name }}/build | |
run: cmake --build . |