Skip to content

Commit

Permalink
Merge pull request #388 from pothosware/ci-improvements-maint
Browse files Browse the repository at this point in the history
Backport CI improvements to maint
  • Loading branch information
ncorgan authored Nov 25, 2022
2 parents df4acc4 + ad1c4bf commit da7b199
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 66 deletions.
215 changes: 149 additions & 66 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,50 @@ on: [push, pull_request]
jobs:
linux-ci:
name: Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
build_type: [Release, Debug]
config:
- cc: gcc-9
cxx: g++-9
build_type: Release
- cc: gcc-9
cxx: g++-9
build_type: Debug
os: ubuntu-20.04

- cc: gcc-10
cxx: g++-10
build_type: Release
- cc: gcc-10
cxx: g++-10
build_type: Debug
os: ubuntu-20.04

- cc: gcc-11
cxx: g++-11
os: ubuntu-22.04

- cc: gcc-12
cxx: g++-12
os: ubuntu-22.04

- cc: clang-10
cxx: clang++-10
build_type: Release
- cc: clang-10
cxx: clang++-10
build_type: Debug
os: ubuntu-20.04

- cc: clang-11
cxx: clang++-11
build_type: Release
- cc: clang-11
cxx: clang++-11
build_type: Debug
os: ubuntu-20.04

- cc: clang-12
cxx: clang++-12
build_type: Release
- cc: clang-12
cxx: clang++-12
build_type: Debug
os: ubuntu-20.04

- cc: clang-13
cxx: clang++-13
os: ubuntu-22.04

- cc: clang-14
cxx: clang++-14
os: ubuntu-22.04
runs-on: ${{matrix.config.os}}
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
CC: ${{matrix.config.cc}}
CXX: ${{matrix.config.cxx}}
PYTHON_EXECUTABLE: /usr/bin/python
PYTHON3_EXECUTABLE: /usr/bin/python3
INSTALL_PREFIX: /usr/local
Expand All @@ -53,7 +55,11 @@ jobs:
- name: Install dependencies
run: |
sudo apt update --fix-missing
sudo apt install -y libpython2-dev libpython3-dev python-numpy python3-numpy doxygen
sudo apt install -y libpython2-dev libpython3-dev python3-numpy doxygen
# Note: we need the grep because apt-cache will return 0 even when no packages are found
if sudo apt-cache search python-numpy | grep 'numpy -'; then sudo apt install -y python-numpy; fi
if sudo apt-cache search python2-numpy | grep 'numpy -'; then sudo apt install -y python2-numpy; fi
- name: Build SoapySDR
run: |
mkdir -p ${{github.workspace}}/build
Expand Down Expand Up @@ -94,49 +100,43 @@ jobs:
${PYTHON3_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.Device.make('driver=null'))"
osx-ci:
name: OS X
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- cc: gcc-9
cxx: g++-9
build_type: Release
build_type: [Release, Debug]
config:
- cc: gcc-9
cxx: g++-9
build_type: Debug
os: macos-11

- cc: gcc-10
cxx: g++-10
build_type: Release
- cc: gcc-10
cxx: g++-10
build_type: Debug
os: macos-11

- cc: gcc-11
cxx: g++-11
build_type: Release
- cc: gcc-11
cxx: g++-11
build_type: Debug
os: macos-11

- cc: clang
cxx: clang++
build_type: Release
- cc: clang
cxx: clang++
build_type: Debug
os: macos-11

# TODO: re-enable after MacOS Monterey Python issue fixed
#
#- cc: clang
#cxx: clang++
#os: macos-12
runs-on: ${{matrix.config.os}}
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
CC: ${{matrix.config.cc}}
CXX: ${{matrix.config.cxx}}
PYTHON_EXECUTABLE: /usr/bin/python
PYTHON3_EXECUTABLE: /usr/bin/python3
INSTALL_PREFIX: /usr/local
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
brew install doxygen
pip install numpy
pip3 install numpy
- name: Build SoapySDR
Expand All @@ -160,53 +160,75 @@ jobs:
SoapySDRUtil --make="driver=null"
windows-ci:
name: Windows
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
# Note: keeping cmake_config general enough for non-MSVC later
include:
- cmake_config: -G "Visual Studio 14 2015" -A "Win32"
arch: win32
build_type: Release
build_type: [Release, Debug]
config:
#
# MSVC
#

- cmake_config: -G "Visual Studio 14 2015" -A "Win32"
arch: win32
build_type: Debug
os: windows-2019
msvc: true

- cmake_config: -G "Visual Studio 14 2015" -A "x64"
arch: x64
build_type: Release
- cmake_config: -G "Visual Studio 14 2015" -A "x64"
arch: x64
build_type: Debug
os: windows-2019
msvc: true

# Note: skipping VS2017, possible bugginess in parallel installs

- cmake_config: -G "Visual Studio 16 2019" -A "Win32"
arch: win32
build_type: Release
- cmake_config: -G "Visual Studio 16 2019" -A "Win32"
arch: win32
build_type: Debug
os: windows-2019
msvc: true

- cmake_config: -G "Visual Studio 16 2019" -A "x64"
arch: x64
build_type: Release
- cmake_config: -G "Visual Studio 16 2019" -A "x64"
os: windows-2019
msvc: true

- cmake_config: -G "Visual Studio 17 2022" -A "Win32"
arch: win32
os: windows-2022
msvc: true

- cmake_config: -G "Visual Studio 17 2022" -A "x64"
arch: x64
build_type: Debug
os: windows-2022
msvc: true

#
# MinGW
#

- cmake_config: -G "MinGW Makefiles"
os: windows-2019
msvc: false

# TODO: reenable after fix
#- cmake_config: -G "MinGW Makefiles"
# os: windows-2022
# msvc: false
runs-on: ${{matrix.config.os}}
env:
# Easier to have multiple copies of a subpath than deal with CI path parsing issues
INSTALL_PREFIX: 'C:\Program Files\SoapySDR'
steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
if:
${{matrix.config.msvc == true}}
with:
arch: ${{matrix.arch}}
arch: ${{matrix.config.arch}}
- name: Build SoapySDR
run: |
mkdir ${{github.workspace}}\build
cd ${{github.workspace}}\build
cmake ${{matrix.cmake_config}} -DENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX="$Env:INSTALL_PREFIX" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{github.workspace}}
cmake ${{matrix.config.cmake_config}} -DENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX="$Env:INSTALL_PREFIX" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{github.workspace}}
cmake --build . --config ${{matrix.build_type}}
- name: Install
run: |
Expand All @@ -223,3 +245,64 @@ jobs:
SoapySDRUtil --info
SoapySDRUtil --check=null
SoapySDRUtil --make="driver=null"
freebsd-ci:
name: FreeBSD
runs-on: macos-12
env:
PYTHON_EXECUTABLE: /usr/local/bin/python3.9
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
release: ["12.3", "13.1"] # TODO: re-enable 13.0 after Python issue fixed
steps:
- uses: actions/checkout@v2
- uses: vmactions/freebsd-vm@v0
name: Test in FreeBSD
with:
envs: "PYTHON_EXECUTABLE"
release: ${{matrix.release}}
copyback: false
prepare: |
pkg install -y cmake devel/swig lang/python3
run: |
# We can't separate these steps, so add prints for clarity.
echo
echo "----------------------------------"
echo "Building..."
echo "----------------------------------"
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ..
make
echo
echo "----------------------------------"
echo "Installing..."
echo "----------------------------------"
make install
echo
echo "----------------------------------"
echo "Running unit tests..."
echo "----------------------------------"
ctest --output-on-failure
echo
echo "----------------------------------"
echo "Testing SoapySDRUtil..."
echo "----------------------------------"
SoapySDRUtil --info
SoapySDRUtil --check=null
SoapySDRUtil --make="driver=null"
echo
echo "----------------------------------"
echo "Testing Python bindings..."
echo "----------------------------------"
${PYTHON_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.getAPIVersion())" || exit 1
${PYTHON_EXECUTABLE} -c "from SoapySDR import *; print(SOAPY_SDR_ABI_VERSION)" || exit 1
${PYTHON_EXECUTABLE} -c "from SoapySDR import *; print(SOAPY_SDR_TIMEOUT)" || exit 1
${PYTHON_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.errToStr(SoapySDR.SOAPY_SDR_TIMEOUT))" || exit 1
${PYTHON_EXECUTABLE} -c "import SoapySDR; print(SoapySDR.Device.make('driver=null'))" || exit 1
45 changes: 45 additions & 0 deletions .github/workflows/cross-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Cross-compile CI
on: [push, pull_request]
jobs:
dockcross:
name: Dockcross
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# TODO: restore with Android support branch
#- image: android-x86_64
#- image: android-arm64
- image: linux-i686
- image: linux-arm64
- image: linux-ppc64le
# Raspberry Pi
- image: linux-armv6
- image: linux-armv6-lts
- image: linux-armv6-musl
- image: linux-armv7
- image: linux-armv7-lts
# Beaglebone
- image: linux-armv7a
# Windows builds not natively supported by Github Actions
- image: windows-static-x64
- image: windows-static-x64-posix
- image: windows-static-x86
- image: windows-shared-x64
- image: windows-shared-x64-posix
- image: windows-shared-x86
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
git clone https://github.com/dockcross/dockcross
- name: Prepare Dockcross script
run: |
cd dockcross
sudo docker run --rm dockcross/${{matrix.image}} > ../dockcross-${{matrix.image}}
sudo chmod +x ../dockcross-${{matrix.image}}
- name: Build SoapySDR
run: |
sudo ./dockcross-${{matrix.image}} cmake -DENABLE_PYTHON=OFF -DENABLE_PYTHON3=OFF -Bbuild -S.
sudo ./dockcross-${{matrix.image}} cmake --build build

0 comments on commit da7b199

Please sign in to comment.