build: Update Github Actions

This commit is contained in:
Christian W. Zuckschwerdt 2024-02-29 11:32:43 +01:00
parent 462e765ddc
commit 8d1541bde0
4 changed files with 43 additions and 62 deletions
.ci/scripts
.github/workflows

View file

@ -1,40 +0,0 @@
#!/bin/sh
set -e
# This script is for internal CI use only
#
# performs a standard out-of-tree build and transform environment vars to cmake options
# set RTLSDR=ON/OFF/AUTO (default: ON)
# set SOAPYSDR=ON/OFF/AUTO (default: AUTO)
# set OPENSSL=ON/OFF/AUTO (default: AUTO)
# set CMAKE_TOOLCHAIN_FILE=file (default: unset)
# set RUN_RTL_433_TESTS=1 (default: unset)
RTLSDR="${RTLSDR:-ON}"
SOAPYSDR="${SOAPYSDR:-AUTO}"
OPENSSL="${OPENSSL:-AUTO}"
set -- -DENABLE_RTLSDR=$RTLSDR -DENABLE_SOAPYSDR=$SOAPYSDR -DENABLE_OPENSSL=$OPENSSL
if [ -n "$CMAKE_TOOLCHAIN_FILE" ] ; then
cmake $@ -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE -GNinja -B build
else
cmake $@ -GNinja -B build
fi
cmake --build build
if [ -n "$RUN_RTL_433_TESTS" ] ; then
cd ..
set -x
git clone --depth 1 https://github.com/merbanan/rtl_433_tests.git
cd rtl_433_tests
export PATH=../build/src:$PATH
test -f ../build/src/rtl_433
# virtualenv --system-site-packages .venv
# source .venv/bin/activate
# pip install deepdiff
make test
fi

24
.ci/scripts/do_tests.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
# This script is for internal CI use only
set -e
set -x
# prefer GNU commands
realpath=$(command -v grealpath || :)
realpath="${realpath:-realpath}"
# remove this script name and two dir levels to get the source root
source_dir=$(dirname $(dirname $(dirname $($realpath -s $0))))
cd "${source_dir}/.."
[ -e rtl_433_tests ] || git clone --depth 1 https://github.com/merbanan/rtl_433_tests.git
cd rtl_433_tests
export PATH="${source_dir}/build/src:$PATH"
test -f "${source_dir}/build/src/rtl_433"
# python3 -m venv .venv
# source .venv/bin/activate
# pip install deepdiff
make test

View file

@ -6,7 +6,7 @@ jobs:
name: Build with CMake
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@latest
- name: Run CMake+Ninja
@ -28,7 +28,7 @@ jobs:
name: Build documentation
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@latest
- name: "Install Doxygen"
@ -46,14 +46,14 @@ jobs:
runs-on: ubuntu-latest
name: Check code style
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Style Check
uses: ./.github/actions/style-check
maintainer_update_check_job:
runs-on: ubuntu-latest
name: Needs maintainer_update
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Working directory clean excluding untracked files
run: |
./maintainer_update.py
@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-latest
name: Check symbol errors
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Symbolizer report
run: |
./tests/symbolizer.py check
@ -77,7 +77,7 @@ jobs:
runs-on: ubuntu-22.04
name: Analyze with Clang
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Clang
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -

View file

@ -16,7 +16,7 @@ jobs:
#runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/cache@v3
- uses: actions/cache@v4
id: downloads
with:
path: ${{ runner.workspace }}/${{ env.pothos-exe }}
@ -34,7 +34,7 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_version: ${{ env.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Release info
@ -74,16 +74,15 @@ jobs:
runs-on: ubuntu-latest
name: Build with Mingw-w64 on ${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Install Mingw-w64"
run: |
sudo apt-get update -q -y
sudo apt-get install -q -y gcc-mingw-w64-base binutils-mingw-w64-${{ matrix.arch }} gcc-mingw-w64-${{ matrix.arch }} mingw-w64-${{ matrix.arch }}-dev gcc-mingw-w64 gcc-multilib p7zip-full
- name: "Build with Mingw-w64"
env:
RTLSDR: OFF
CMAKE_TOOLCHAIN_FILE: cmake/Toolchain-gcc-mingw-w64-${{ matrix.arch }}.cmake
run: ./.ci/scripts/do_build.sh
run: |
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-gcc-mingw-w64-${{ matrix.arch }}.cmake -DENABLE_RTLSDR=OFF -B build
cmake --build build
- name: "Sysroot Build with Mingw-w64"
run: ./.ci/scripts/do_sysroot.sh
- name: "Upload Release Asset"
@ -121,8 +120,8 @@ jobs:
steps:
- run: choco install openssl
if: matrix.platform == 'x64'
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: downloads
if: matrix.platform == 'x64'
with:
@ -226,7 +225,7 @@ jobs:
runs-on: ${{ matrix.os }}
name: Build with CMake on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install SDR
run: |
sudo apt-get update -q
@ -273,7 +272,7 @@ jobs:
distro: buster
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2.0.8
id: runcmd
with:
@ -309,11 +308,9 @@ jobs:
uname -a
lsb_release -sc || echo NO lsb_release
echo Release ${{ needs.release_job.outputs.release_version }}
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=../dist ..
cmake --build .
cmake --build . --target install
cmake -DCMAKE_INSTALL_PREFIX:PATH=../dist -B build
cmake --build build
cmake --build build --target install
- name: Install FPM
run: |