diff options
Diffstat (limited to '.github/workflows/build-and-test.yml')
| -rw-r--r-- | .github/workflows/build-and-test.yml | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f330d27..8653739 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,7 +1,7 @@ # Copyright (C) 2021 Sebastian Pipping <sebastian@pipping.org> # Licensed under the MIT license -name: Build and test +name: Build and test (Linux) on: pull_request: @@ -11,30 +11,30 @@ on: jobs: build_and_test: - name: Build and test + name: Build and test (Linux) strategy: matrix: include: - name: Native Linux cmake_args: >- - -DCMAKE_C_COMPILER=clang-18 - -DCMAKE_CXX_COMPILER=clang++-18 + -DCMAKE_C_COMPILER=clang-21 + -DCMAKE_CXX_COMPILER=clang++-21 cflags: >- -fsanitize=address,undefined,leak -fno-sanitize-recover=all -fno-omit-frame-pointer ldflags: >- -fsanitize=address,undefined,leak - - name: MingGW on Linux + - name: MinGW on Linux cmake_args: >- -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ -DCMAKE_SYSTEM_NAME=Windows -DWIN32=ON -DMINGW=ON - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Add Clang/LLVM repositories (Non-MinGW) if: "${{ ! contains(matrix.cmake_args, 'mingw') }}" @@ -42,7 +42,7 @@ jobs: 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}-18 main" + sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-21 main" - name: Install build dependencies run: |- @@ -59,20 +59,7 @@ jobs: - name: Install build dependencies (MinGW) if: "${{ contains(matrix.cmake_args, 'mingw') }}" run: |- - set -x -u -o pipefail - source /etc/os-release - - # Get rid of packages installed from ppa:ondrej/php so that we will be able to install wine32:i386 without conflicts - # (see issue https://github.com/actions/virtual-environments/issues/4589) - # In detail we: - # 1. Remove all packages that ppa:ondrej/php has but plain Ubuntu doesn't, e.g. everything PHP - # 2. Revert (remaining) packages that ppa:ondrej/php and plain Ubuntu share, back to the plain Ubuntu version - # 3. Assert that no packages from ppa:ondrej/php are left installed - dpkg -l | grep '^ii' | fgrep deb.sury.org | awk '{print $2}' | grep '^php' \ - | xargs -r -t sudo apt-get remove --yes libpcre2-posix3 libzip4 - dpkg -l | grep '^ii' | fgrep deb.sury.org | awk '{print $2}' | sed "s,\$,/${UBUNTU_CODENAME}," \ - | xargs -r -t sudo apt-get install --yes --no-install-recommends --allow-downgrades -V - ! dpkg -l | grep '^ii' | fgrep deb.sury.org + set -x # Install 32bit Wine sudo dpkg --add-architecture i386 # for wine32 @@ -86,8 +73,8 @@ jobs: if: "${{ ! contains(matrix.cmake_args, 'mingw') }}" run: |- sudo apt-get install --yes --no-install-recommends -V \ - clang-18 \ - libclang-rt-18-dev + clang-21 \ + libclang-rt-21-dev - name: Build, test and install run: |- @@ -103,8 +90,8 @@ jobs: ( cd googletest-release-${GTEST_VERSION}/ - # Silence warning "Compatibility with CMake < 2.8.12 will be removed" - find -name CMakeLists.txt -print -exec sed 's/cmake_minimum_required.*/cmake_minimum_required(VERSION 3.5.0)/' -i {} \; + # Silence warning "Compatibility with CMake < 3.10 will be removed" + find -name CMakeLists.txt -print -exec sed 's/cmake_minimum_required.*/cmake_minimum_required(VERSION 3.10.0)/' -i {} \; cmake \ -DBUILD_SHARED_LIBS=ON \ @@ -129,8 +116,8 @@ jobs: -Wextra -pedantic ) - CFLAGS="${compile_flags[*]} -std=c89" - CXXFLAGS="${compile_flags[*]} -std=c++98" + CFLAGS="${compile_flags[*]} -std=c99" + CXXFLAGS="${compile_flags[*]} -std=c++11" LDFLAGS='-g ${{ matrix.ldflags }}' cmake_args=( -DCMAKE_INSTALL_PREFIX:PATH=${GTEST_PREFIX} @@ -148,6 +135,7 @@ jobs: ${{ matrix.cmake_args }} + -DURIPARSER_BUILD_TESTS=ON -DURIPARSER_WARNINGS_AS_ERRORS=ON ) cmake "${cmake_args[@]}" -DCMAKE_INSTALL_INCLUDEDIR=include123 .. @@ -157,12 +145,19 @@ jobs: # NOTE: We need to copy some .dll files next to the # Windows binaries so that they are ready to be executed if [[ "${{ matrix.cmake_args }}" == *mingw* ]]; then - cp /usr/lib/gcc/i686-w64-mingw32/*-posix/libgcc_s_sjlj-1.dll ./ + cp /usr/lib/gcc/i686-w64-mingw32/*-posix/libgcc_s_dw2-1.dll ./ cp /usr/lib/gcc/i686-w64-mingw32/*-posix/libstdc++-6.dll ./ cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll ./ cp "${GTEST_PREFIX}"/bin/libgtest.dll ./ fi + # Configure UBSan to show (non-default) stack traces for runtime errors + # NOTE: "halt_on_error=1" we don't need to add because of the + # -fno-sanitize-recover=all for CFLAGS further up. + # NOTE: "abort_on_error=1" we don't need here because to CI, + # a non-zero exit code is all that matters. + export UBSAN_OPTIONS='print_stacktrace=1' + make VERBOSE=1 test ARGS=--verbose cat Testing/Temporary/LastTest.log |
