-
-
Notifications
You must be signed in to change notification settings - Fork 5
156 lines (132 loc) · 4.62 KB
/
soapy-build.yml
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
name: SoapySDR module build tests
on:
pull_request:
paths:
- "software/soapy/**"
branches: [ "v2" ]
push:
paths:
- "software/soapy/**"
branches: [ "v2" ]
workflow_dispatch:
env:
SOAPY_BRANCH: "soapy-sdr-0.8.1"
SOAPY_VERSION: "0.8"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: amd64
lib-arch: x86_64
- arch: arm64
lib-arch: aarch64
steps:
- name: Update install
run:
sudo apt-get update
timeout-minutes: 5
- name: Install build dependencies
run: |
if [[ "${{matrix.arch}}" == "amd64" ]]; then
# Native
sudo apt-get install build-essential
elif [[ "${{matrix.arch}}" == "arm64" ]]; then
# 64-bit ARM
sudo apt-get install crossbuild-essential-arm64
fi
sudo apt-get install cmake
timeout-minutes: 5
- name: Install SoapySDR
run: |
git clone --depth=1 --branch $SOAPY_BRANCH https://github.com/pothosware/SoapySDR
cd SoapySDR
mkdir build
cd build
if [[ "${{matrix.arch}}" == "amd64" ]]; then
# Native
cmake \
-D ENABLE_APPS=OFF \
-D ENABLE_LIBRARY=ON \
-D ENABLE_PYTHON=OFF \
-D ENABLE_PYTHON3=OFF \
-D ENABLE_TESTS=OFF \
..
elif [[ "${{matrix.arch}}" == "arm64" ]]; then
# 64-bit ARM
CROSS_COMPILE=aarch64-linux-gnu-
cmake \
-D ENABLE_APPS=OFF \
-D ENABLE_LIBRARY=ON \
-D ENABLE_PYTHON=OFF \
-D ENABLE_PYTHON3=OFF \
-D ENABLE_TESTS=OFF \
-D CMAKE_C_COMPILER=${CROSS_COMPILE}gcc \
-D CMAKE_CXX_COMPILER=${CROSS_COMPILE}g++ \
-D CMAKE_AR=${CROSS_COMPILE}ar \
-D CMAKE_C_COMPILER_AR=${CROSS_COMPILE}gcc-ar \
-D CMAKE_C_COMPILER_RANLIB=${CROSS_COMPILE}gcc-ranlib \
-D CMAKE_LINKER=${CROSS_COMPILE}ld \
-D CMAKE_NM=${CROSS_COMPILE}nm \
-D CMAKE_OBJCOPY=${CROSS_COMPILE}objcopy \
-D CMAKE_OBJDUMP=${CROSS_COMPILE}objdump \
-D CMAKE_RANLIB=${CROSS_COMPILE}ranlib \
-D CMAKE_STRIP=${CROSS_COMPILE}strip \
..
fi
make -j$(nproc)
sudo make install
sudo ldconfig
timeout-minutes: 5
- uses: actions/checkout@v3
with:
fetch-depth: 1
clean: true
- name: Build SoapySDR module (${{matrix.arch}})
run: |
cd ${{github.workspace}}/software/soapy
mkdir build
cd build
if [[ "${{matrix.arch}}" == "amd64" ]]; then
# Native
cmake ..
elif [[ "${{matrix.arch}}" == "arm64" ]]; then
# 64-bit ARM
CROSS_COMPILE=aarch64-linux-gnu-
cmake \
-D CMAKE_C_COMPILER=${CROSS_COMPILE}gcc \
-D CMAKE_CXX_COMPILER=${CROSS_COMPILE}g++ \
-D CMAKE_AR=${CROSS_COMPILE}ar \
-D CMAKE_C_COMPILER_AR=${CROSS_COMPILE}gcc-ar \
-D CMAKE_C_COMPILER_RANLIB=${CROSS_COMPILE}gcc-ranlib \
-D CMAKE_LINKER=${CROSS_COMPILE}ld \
-D CMAKE_NM=${CROSS_COMPILE}nm \
-D CMAKE_OBJCOPY=${CROSS_COMPILE}objcopy \
-D CMAKE_OBJDUMP=${CROSS_COMPILE}objdump \
-D CMAKE_RANLIB=${CROSS_COMPILE}ranlib \
-D CMAKE_STRIP=${CROSS_COMPILE}strip \
..
fi
make -j$(nproc)
- name: Make deb package (${{matrix.arch}})
run: |
mkdir deb
mkdir deb/DEBIAN
cp ${{github.workspace}}/software/soapy/.deb/* deb/DEBIAN/
echo "Architecture: ${{matrix.arch}}" >> deb/DEBIAN/control
echo "" >> deb/DEBIAN/control
mkdir -p deb/usr/lib/${{matrix.lib-arch}}-linux-gnu/SoapySDR/modules${SOAPY_VERSION}
cp ${{github.workspace}}/software/soapy/build/libIcyRadioSupport.so deb/usr/lib/${{matrix.lib-arch}}-linux-gnu/SoapySDR/modules${SOAPY_VERSION}
mkdir -p deb/usr/bin
cp ${{github.workspace}}/software/soapy/build/IcyRadioTool deb/usr/bin
dpkg-deb --build --root-owner-group ./deb ${{github.workspace}}/software/soapy/soapysdr-module-icyradio_${{matrix.arch}}.deb
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: soapy_module_${{matrix.arch}}
path: |
${{github.workspace}}/software/soapy/build/libIcyRadioSupport.so
${{github.workspace}}/software/soapy/build/IcyRadioTool
${{github.workspace}}/software/soapy/soapysdr-module-icyradio_${{matrix.arch}}.deb
retention-days: 30