Core (Tests): Fix building of tests. #956
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test (Linux) | |
on: | |
pull_request: | |
push: | |
schedule: | |
- cron: '0 3 * * 5' # Every Friday at 3am | |
env: | |
LV_BUILD_TYPE: Debug | |
LV_INSTALL_PREFIX: /home/runner/.local/ | |
jobs: | |
linux: | |
name: Build and test (Linux) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- cc: gcc-13 | |
cxx: g++-13 | |
clang_major_version: null | |
clang_repo_suffix: null | |
- cc: clang-18 | |
cxx: clang++-18 | |
clang_major_version: 18 | |
clang_repo_suffix: -18 | |
steps: | |
- name: Add Clang/LLVM repositories | |
if: "${{ contains(matrix.cxx, 'clang') }}" | |
run: |- | |
set -x | |
source /etc/os-release | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}${{ matrix.clang_repo_suffix }} main" | |
- name: Install build dependencies | |
run: |- | |
sudo apt-get update | |
# Note: This additional step's sole purpuse is to workaround symptom: | |
# > The following packages have unmet dependencies: | |
# > libunwind-14-dev : Breaks: libunwind-dev but 1.3.2-2build2 | |
# > is to be installed | |
sudo apt-get install --yes --no-install-recommends libunwind-dev | |
sudo apt-get install --yes --no-install-recommends \ | |
bison \ | |
doxygen \ | |
flex \ | |
gettext \ | |
graphviz \ | |
libgstreamer1.0-dev \ | |
libgtk2.0-dev \ | |
libjack-dev \ | |
libluajit-5.1-dev \ | |
liborc-0.4-dev \ | |
libpng-dev \ | |
libasound2-dev \ | |
libsdl1.2-dev \ | |
libgl1-mesa-dev \ | |
pkg-config \ | |
portaudio19-dev | |
- name: Install build dependency Clang ${{ matrix.clang_major_version }} | |
if: "${{ contains(matrix.cxx, 'clang') }}" | |
run: |- | |
sudo apt-get install --yes --no-install-recommends -V \ | |
clang-${{ matrix.clang_major_version }} | |
- name: Checkout Git branch | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: '[LV] Run CMake' | |
run: |- | |
mkdir build_lv | |
cd build_lv | |
cmake \ | |
-DCMAKE_C_COMPILER=${{ matrix.cc }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \ | |
-DCMAKE_BUILD_TYPE=${LV_BUILD_TYPE} \ | |
-DCMAKE_INSTALL_PREFIX:PATH=${LV_INSTALL_PREFIX} \ | |
\ | |
-DENABLE_DOCS=yes \ | |
-DENABLE_FATAL_WARNINGS=yes \ | |
-DENABLE_TESTS=yes \ | |
../libvisual/ \ | |
- name: '[LV] Run "make"' | |
run: |- | |
make -C build_lv -j2 VERBOSE=1 | |
- name: '[LV] Run "make install"' | |
run: |- | |
make -C build_lv install | |
find ${LV_INSTALL_PREFIX} | sort | |
- name: '[Plugins] Run CMake' | |
run: |- | |
mkdir build_plugins | |
cd build_plugins | |
PKG_CONFIG_PATH=${LV_INSTALL_PREFIX}/lib/pkgconfig/ \ | |
cmake \ | |
-DCMAKE_C_COMPILER=${{ matrix.cc }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \ | |
-DCMAKE_BUILD_TYPE=${LV_BUILD_TYPE} \ | |
-DCMAKE_INSTALL_PREFIX:PATH=${LV_INSTALL_PREFIX} \ | |
\ | |
-DENABLE_FATAL_WARNINGS=yes \ | |
../libvisual-plugins/ | |
- name: '[Plugins] Run "make"' | |
run: |- | |
set -x -o pipefail | |
make -C build_plugins -j2 VERBOSE=1 | |
# Detect and deny underlinking | |
! find -name \*.so | sort | xargs ldd -r | grep -F 'undefined symbol' | |
- name: '[Plugins] Run "make install"' | |
run: |- | |
make -C build_plugins install DESTDIR="${PWD}"/ROOT_PLUGINS | |
find ROOT_PLUGINS/ | sort | |
- name: '[LV] Run tests (exit code ignored for now!)' | |
# TODO Fix tests and remove " || true" here | |
run: |- | |
make -C build_lv \ | |
CMAKE_CONFIG_TYPE=${LV_BUILD_TYPE} \ | |
CTEST_OUTPUT_ON_FAILURE=1 \ | |
VERBOSE=1 \ | |
test || true |