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
|
name: Build
on:
push:
pull_request:
# Run automatically every monday
schedule:
- cron: 1 12 * * 1
env:
# Override OSX architecture detection. Required for CMake versions < 3.19.2.
CMAKE_OSX_ARCHITECTURES: arm64
jobs:
host:
strategy:
matrix:
sys:
- {os: 'macos', shell: 'bash'}
- {os: 'ubuntu', shell: 'bash'}
- {os: 'windows', shell: 'pwsh'}
- {os: 'windows', shell: 'msys2'}
cmake: ['3.10.0', '3.16.0', '3.21.0', '4.0.0', 'latest']
exclude:
# GitHub runners use Visual Studio 2022. Support added in CMake 3.21.
- sys: {os: 'windows', shell: 'pwsh'}
cmake: '3.10.0'
- sys: {os: 'windows', shell: 'pwsh'}
cmake: '3.16.0'
# MSYS2 always supplies the latest cmake.
- sys: {os: 'windows', shell: 'msys2'}
cmake: '3.10.0'
- sys: {os: 'windows', shell: 'msys2'}
cmake: '3.16.0'
- sys: {os: 'windows', shell: 'msys2'}
cmake: '3.21.0'
- sys: {os: 'windows', shell: 'msys2'}
cmake: '4.0.0'
include:
- sys: {os: 'windows', shell: 'pwsh'}
cmake_args: >-
-DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
--install-prefix=$env:GITHUB_WORKSPACE/install
- sys: {os: 'windows', shell: 'msys2'}
cmake_args: >-
--install-prefix=/usr/local
# Don't cancel all builds when one fails
fail-fast: false
runs-on: ${{ matrix.sys.os }}-latest
defaults:
run:
shell: '${{ matrix.sys.shell }} {0}'
steps:
- uses: actions/checkout@v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ matrix.cmake }}
if: matrix.sys.shell != 'msys2'
- name: Install dependencies (macOS)
run: brew install fftw
if: matrix.sys.os == 'macos'
- name: Install dependencies (Ubuntu)
run: |
sudo apt update
sudo apt install libfftw3-dev libusb-1.0-0-dev
if: matrix.sys.os == 'ubuntu'
- name: Install dependencies (Windows)
run: vcpkg install --triplet=x64-windows libusb fftw3 pthreads pkgconf
if: matrix.sys.os == 'windows' && matrix.sys.shell != 'msys2'
- name: Setup MSYS (Windows)
if: matrix.sys.os == 'windows' && matrix.sys.shell == 'msys2'
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: >-
git
make
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-libusb
mingw-w64-ucrt-x86_64-fftw
# Build libhackrf and hackrf-tools together
- name: Configure & Build
run: |
cmake -E make_directory host/build
cd host/build
cmake .. -DCMAKE_BUILD_TYPE=Release ${{matrix.cmake_args}}
cmake --build . --config Release
# Build libhackrf ONLY
- name: Configure & Build (libhackrf)
run: |
cmake -E make_directory host/libhackrf/build
cd host/libhackrf/build
cmake .. -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_args }}
cmake --build . --config Release
- name: Install (libhackrf)
run: |
sudo cmake --install host/libhackrf/build --config Release
if: matrix.sys.os != 'windows' && matrix.cmake != '3.10.0'
- name: Install (libhackrf, CMake 3.10)
run: |
sudo cmake --build host/libhackrf/build --target install --config Release
if: matrix.sys.os != 'windows' && matrix.cmake == '3.10.0'
- name: Install (libhackrf, Windows)
run: cmake --install host/libhackrf/build --config Release
if: matrix.sys.os == 'windows'
# Build hackrf-tools ONLY
- name: Configure & Build (hackrf-tools)
run: |
cmake -E make_directory host/hackrf-tools/build
cd host/hackrf-tools/build
cmake .. -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_args }}
cmake --build . --config Release
- name: Install (hackrf-tools)
run: |
sudo cmake --install host/hackrf-tools/build --config Release
if: matrix.sys.os != 'windows' && matrix.cmake != '3.10.0'
- name: Install (hackrf-tools, CMake 3.10)
run: |
sudo cmake --build host/hackrf-tools/build --target install --config Release
if: matrix.sys.os != 'windows' && matrix.cmake == '3.10.0'
- name: Install (hackrf-tools, Windows)
run: cmake --install host/hackrf-tools/build --config Release
if: matrix.sys.os == 'windows'
# Publish the contents of install/bin (which should be the combination libhackrf and host-tools) for Windows
- name: Publish Artifacts (Windows)
uses: actions/upload-artifact@v4
with:
name: hackrf-tools-windows
path: ${{github.workspace}}/install/bin
if: matrix.sys.os == 'windows' && matrix.cmake == 'latest' && matrix.sys.shell == 'pwsh'
firmware:
strategy:
matrix:
os: ['macos', 'ubuntu', 'windows']
board: ['HACKRF_ONE', 'JAWBREAKER', 'RAD1O', 'PRALINE']
cmake: ['3.10.0', 'latest']
exclude:
- os: 'windows'
cmake: '3.10.0'
# Don't cancel all builds when one fails
fail-fast: false
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ matrix.cmake }}
if: matrix.os != 'windows'
- name: Install Arm GNU Toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1
if: matrix.os != 'windows'
- name: Install dependencies (macOS)
run: |
brew install dfu-util
python3 -m venv environment && source environment/bin/activate
python3 -m pip install PyYAML
if: matrix.os == 'macos'
- name: Install dependencies (Ubuntu)
run: |
python3 -m venv environment && source environment/bin/activate
python3 -m pip install PyYAML
sudo apt install dfu-util
if: matrix.os == 'ubuntu'
- name: Build libopencm3
shell: bash
working-directory: ${{github.workspace}}/firmware/libopencm3/
run: |
source ../../environment/bin/activate
make
if: matrix.os != 'windows'
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/firmware/build
if: matrix.os != 'windows'
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/firmware/build
run: cmake $GITHUB_WORKSPACE/firmware/ -DCMAKE_BUILD_TYPE=Release -DBOARD=${{ matrix.board }}
if: matrix.os != 'windows'
- name: Build
working-directory: ${{github.workspace}}/firmware/build
shell: bash
run: |
source ../../environment/bin/activate
cmake --build . --config Release
if: matrix.os != 'windows'
- name: Setup MSYS (Windows)
if: matrix.os == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
git
make
mingw-w64-ucrt-x86_64-arm-none-eabi-gcc
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-dfu-util
mingw-w64-ucrt-x86_64-python-yaml
- name: Build with MSYS (Windows)
if: matrix.os == 'windows'
shell: msys2 {0}
run: |
mkdir firmware/build
cd firmware/build
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DBOARD=${{ matrix.board }} ..
make
|