-
Notifications
You must be signed in to change notification settings - Fork 1k
214 lines (195 loc) · 6.44 KB
/
Copy pathbuild_linux.yml
File metadata and controls
214 lines (195 loc) · 6.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
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@v7
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@main
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@main
secrets: inherit