-
Notifications
You must be signed in to change notification settings - Fork 29
275 lines (228 loc) · 10.5 KB
/
cmake.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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
name: CI
on: [push, pull_request, workflow_dispatch]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
dep_target:
runs-on: ubuntu-latest
outputs:
target_ref: ${{ steps.dep_target.outputs.target_ref }}
steps:
- name: Determine dependencies target branch
id: dep_target
run: |
target_ref="develop"
echo "Checking PR base reference..."
if [ ! -z "${{ github.base_ref }}" ]
then
echo "Base reference: ${{ github.base_ref }}"
if [ ! -z "$(echo ${{ github.base_ref }} | grep -E "^refs/.*/master$")" ]
then
echo "Reference to master found!"
target_ref="master"
fi
fi
echo "Checking reference..."
if [ ! -z "${{ github.ref }}" ]
then
echo "Reference: ${{ github.ref }}"
if [ ! -z "$(echo ${{ github.ref }} | grep -E "^refs/.*/master$")" ]
then
echo "Reference to master found!"
target_ref="master"
fi
fi
echo "Targetting '${target_ref}' branch..."
echo "target_ref=${target_ref}" >> $GITHUB_OUTPUT
build-linux:
needs: dep_target
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: sudo apt-get install libsndfile1-dev libjson-c-dev libvolk2-dev libfftw3-dev soapysdr-module-all libsoapysdr-dev libxml2-dev portaudio19-dev
- name: Checkout (sigutils)
uses: actions/checkout@v3
with:
repository: BatchDrake/sigutils
ref: ${{needs.dep_target.outputs.target_ref}}
path: sigutils
submodules: recursive
fetch-depth: 0
- name: Configure CMake (sigutils)
run: |
cd sigutils
cmake -DCMAKE_INSTALL_PREFIX=/usr -B ${{github.workspace}}/sigutils/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} .
cd ..
- name: Build (sigutils)
run: cmake --build ${{github.workspace}}/sigutils/build --config ${{env.BUILD_TYPE}}
- name: Install system-wide (sigutils)
run: sudo cmake --build ${{github.workspace}}/sigutils/build --config ${{env.BUILD_TYPE}} --target install
- name: Checkout
uses: actions/checkout@v3
with:
path: suscan
submodules: recursive
fetch-depth: 0
- name: Get short hash
id: vars
run: cd ${{github.workspace}}/suscan/ && echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Configure CMake (suscan)
run: cmake -DSUSCAN_PKGDIR="/usr" -DPKGVERSION="${{steps.vars.outputs.sha_short}}" -DCMAKE_INSTALL_PREFIX=/usr -B ${{github.workspace}}/suscan/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} suscan
- name: Build (suscan)
run: cmake --build ${{github.workspace}}/suscan/build --config ${{env.BUILD_TYPE}}
- name: Make Debian packages
run: cd ${{github.workspace}}/suscan/ && ./makedeb.sh 0.3.0 ${{steps.vars.outputs.sha_short}}
- name: Upload lib deb artifact
uses: actions/upload-artifact@v3
with:
name: libsuscan_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
path: ${{github.workspace}}/suscan/libsuscan_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
- name: Upload lib dev deb artifact
uses: actions/upload-artifact@v3
with:
name: libsuscan-dev_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
path: ${{github.workspace}}/suscan/libsuscan-dev_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
- name: Upload tools deb artifact
uses: actions/upload-artifact@v3
with:
name: suscan-tools_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
path: ${{github.workspace}}/suscan/suscan-tools_0.3.0-${{steps.vars.outputs.sha_short}}_amd64.deb
build-macos:
needs: dep_target
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
# Add custom homebrew repos
brew tap pothosware/homebrew-pothos
brew update
# Install deps
# soapyaudio removed from due to deprecated hamlib API
# soapyosmo removed because of random compilation errors
# soapyairspyhf removed because of random compilation errors
brew install --force --overwrite [email protected]
brew install libsndfile volk fftw soapysdr libxml2 portaudio json-c
python3 -Im pip install setuptools
# sudo rm /usr/local/bin/2to3* /usr/local/bin/idle3* /usr/local/bin/pydoc3*
brew install soapyrtlsdr soapyhackrf soapybladerf soapyairspy soapyredpitaya soapyiris limesuite soapyplutosdr
brew install --head soapyuhd
# TODO: needed?
#sudo mkdir -p /usr/local/lib/SoapySDR/modules0.8
#sudo chmod -R a+rw /usr/local/lib/SoapySDR/modules0.8
# SDRPlay API
wget https://www.sdrplay.com/software/SDRplay_RSP_API-MacOSX-3.07.3.pkg
sudo installer -pkg SDRplay_RSP_API-MacOSX-3.07.3.pkg -target /
# SoapySDRPlay3 from source
git clone https://github.com/pothosware/SoapySDRPlay3
cd SoapySDRPlay3
cmake -DCMAKE_BUILD_TYPE=Release -B build .
cmake --build build
cd build
sudo make install
cd ../..
- name: Checkout (sigutils)
uses: actions/checkout@v3
with:
repository: BatchDrake/sigutils
ref: ${{needs.dep_target.outputs.target_ref}}
path: sigutils
submodules: recursive
fetch-depth: 0
- name: Configure CMake (sigutils)
run: |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
cmake -B ${{github.workspace}}/sigutils/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} sigutils
- name: Build (sigutils)
run: cmake --build ${{github.workspace}}/sigutils/build --config ${{env.BUILD_TYPE}}
- name: Install system-wide (sigutils)
run: sudo cmake --build ${{github.workspace}}/sigutils/build --config ${{env.BUILD_TYPE}} --target install
- name: Checkout (suscan)
uses: actions/checkout@v3
with:
path: suscan
submodules: recursive
fetch-depth: 0
- name: Configure CMake (suscan)
run: |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
cmake -B ${{github.workspace}}/suscan/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} suscan
- name: Build (suscan)
run: cmake --build ${{github.workspace}}/suscan/build --config ${{env.BUILD_TYPE}}
build-windows:
needs: dep_target
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-cc mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-libsndfile mingw-w64-x86_64-fftw mingw-w64-x86_64-volk mingw-w64-x86_64-libxml2 mingw-w64-x86_64-libusb
- name: Checkout (sigutils)
uses: actions/checkout@v3
with:
repository: BatchDrake/sigutils
ref: ${{needs.dep_target.outputs.target_ref}}
path: sigutils
submodules: recursive
fetch-depth: 0
- name: Configure sigutils
run: /mingw64/bin/cmake -G"MinGW Makefiles" -B D:\\a\\suscan\\suscan\\sigutils\\build -DCMAKE_INSTALL_PREFIX:PATH=C:\\msys64\\mingw64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} D:\\a\\suscan\\suscan\\sigutils
- name: Build sigutils
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\sigutils\\build --config ${{env.BUILD_TYPE}}
- name: Install sigutils
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\sigutils\\build --config ${{env.BUILD_TYPE}} --target install
# SoapySDR
- name: Checkout (soapysdr)
uses: actions/checkout@v3
with:
repository: pothosware/SoapySDR
ref: refs/heads/master
path: SoapySDR
- name: Configure
run: /mingw64/bin/cmake -G"MinGW Makefiles" -B D:\\a\\suscan\\suscan\\SoapySDR\\build -DCMAKE_INSTALL_PREFIX:PATH=C:\\msys64\\mingw64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} D:\\a\\suscan\\suscan\\SoapySDR\\
- name: Build
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\SoapySDR\\build --config ${{env.BUILD_TYPE}}
- name: Install sigutils
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\SoapySDR\\build --config ${{env.BUILD_TYPE}} --target install
# BatchDrake's fixed rtl-sdr
- name: Checkout (rtl-sdr-blog)
uses: actions/checkout@v3
with:
repository: BatchDrake/rtl-sdr-blog
ref: refs/heads/feature/xfer-completion
path: rtl-sdr-blog
- name: Configure
run: /mingw64/bin/cmake -G"MinGW Makefiles" -B D:\\a\\suscan\\suscan\\rtl-sdr-blog\\build -DCMAKE_INSTALL_PREFIX:PATH=C:\\msys64\\mingw64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} D:\\a\\suscan\\suscan\\rtl-sdr-blog\\
- name: Build
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\rtl-sdr-blog\\build --config ${{env.BUILD_TYPE}}
- name: Install
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\rtl-sdr-blog\\build --config ${{env.BUILD_TYPE}} --target install
# SoapyRTLSDR
- name: Checkout (soapyrtlsdr)
uses: actions/checkout@v3
with:
repository: pothosware/SoapyRTLSDR
ref: refs/heads/master
path: SoapyRTLSDR
- name: Configure
run: /mingw64/bin/cmake -G"MinGW Makefiles" -B D:\\a\\suscan\\suscan\\SoapyRTLSDR/build -DCMAKE_INSTALL_PREFIX:PATH=C:\\msys64\\mingw64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} D:\\a\\suscan\\suscan\\SoapyRTLSDR\\
- name: Build
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\SoapyRTLSDR\\build --config ${{env.BUILD_TYPE}}
- name: Install
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\SoapyRTLSDR\\build --config ${{env.BUILD_TYPE}} --target install
# suscan
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Configure CMake
run: |
export PKG_CONFIG_PATH=C:\\msys64\\mingw64\\lib\\pkgconfig\\
/mingw64/bin/cmake -B D:\\a\\suscan\\suscan\\build -G"MinGW Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=C:\\msys64\\mingw64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} D:\\a\\suscan\\suscan\\
- name: Build
run: /mingw64/bin/cmake --build D:\\a\\suscan\\suscan\\build --config ${{env.BUILD_TYPE}}