Skip to content

🩹 Relax message_base range constructor constraints #735

🩹 Relax message_base range constructor constraints

🩹 Relax message_base range constructor constraints #735

Workflow file for this run

name: Unit Tests
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
DEBIAN_FRONTEND: noninteractive
CMAKE_GENERATOR: Ninja
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_and_test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [clang, gcc]
version: [12, 14, 15]
cxx_standard: [20]
build_type: [Debug]
include:
- version: 15
compiler: clang
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 15
cc: "/usr/lib/llvm-15/bin/clang"
cxx: "/usr/lib/llvm-15/bin/clang++"
- version: 14
compiler: clang
install: sudo apt update && sudo apt install -y clang-14
cc: "/usr/lib/llvm-14/bin/clang"
cxx: "/usr/lib/llvm-14/bin/clang++"
- version: 12
compiler: gcc
install: sudo apt update && sudo apt install -y gcc-12
cc: "/usr/bin/gcc-12"
cxx: "/usr/bin/g++-12"
exclude:
- compiler: gcc
version: 15
- compiler: gcc
version: 14
- compiler: clang
version: 12
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: |
${{ matrix.install }}
sudo apt install -y ninja-build
- name: Configure CMake
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CXX_STANDARD: ${{ matrix.cxx_standard }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
- name: Build Unit Tests
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -t build_unit_tests
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -j $(nproc) -C ${{matrix.build_type}}
quality_checks_pass:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 15
sudo apt install -y ninja-build clang-tidy-15 clang-format-15
- name: Install cmake-format
run: |
pip3 install --upgrade pip
pip3 install pyyaml cmake-format
- name: Configure CMake
env:
CC: "/usr/lib/llvm-15/bin/clang"
CXX: "/usr/lib/llvm-15/bin/clang++"
CXX_STANDARD: 20
CLANG_TOOLS_PATH: "/usr/lib/llvm-15/bin"
run: cmake -B ${{github.workspace}}/build
- name: Run quality checks
run: cmake --build ${{github.workspace}}/build -t quality
sanitize:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
sanitizer: [undefined, address, thread]
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 15
sudo apt install -y ninja-build
- name: Configure CMake
env:
CC: "/usr/lib/llvm-15/bin/clang"
CXX: "/usr/lib/llvm-15/bin/clang++"
CXX_STANDARD: 20
SANITIZERS: ${{matrix.sanitizer}}
run: cmake -B ${{github.workspace}}/build
- name: Build Unit Tests
run: cmake --build ${{github.workspace}}/build -t unit_tests
valgrind:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: sudo apt update && sudo apt install -y gcc-12 ninja-build valgrind
- name: Configure CMake
env:
CC: "/usr/bin/gcc-12"
CXX: "/usr/bin/g++-12"
CXX_STANDARD: 20
run: cmake -B ${{github.workspace}}/build
- name: Build Unit Tests
run: cmake --build ${{github.workspace}}/build -t build_unit_tests
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -j $(nproc) -T memcheck
LOGFILE=$(ls ./Testing/Temporary/LastDynamicAnalysis_*.log)
FAILSIZE=$(du -c ./Testing/Temporary/MemoryChecker.* | tail -1 | cut -f1)
echo "<details>" >> $GITHUB_STEP_SUMMARY
echo "<summary>" >> $GITHUB_STEP_SUMMARY
if [ $FAILSIZE != "0" ]; then
echo "Failing tests:" | tee -a $GITHUB_STEP_SUMMARY
else
echo "No failing tests" >> $GITHUB_STEP_SUMMARY
fi
echo "</summary>" >> $GITHUB_STEP_SUMMARY
for f in ./Testing/Temporary/MemoryChecker.*
do
if [ -s $f ]; then
FILENAME=$(cd $(dirname $f) && pwd)/$(basename $f)
TEST_COMMAND=$(grep $FILENAME $LOGFILE)
echo "" | tee -a $GITHUB_STEP_SUMMARY
echo "========================================"
echo $TEST_COMMAND | tee -a $GITHUB_STEP_SUMMARY
echo "--------------------"
cat $f
fi
done
echo "</details>" >> $GITHUB_STEP_SUMMARY
test $FAILSIZE = "0"
merge_ok:
runs-on: ubuntu-22.04
needs: [build_and_test, quality_checks_pass, sanitize, valgrind]
steps:
- name: Enable merge
run: echo "OK to merge!"
build_single_header:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: |
sudo apt install -y ninja-build
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build
- name: Build
run: cmake --build ${{github.workspace}}/build -t release_header
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: cib.hpp
path: ${{github.workspace}}/build/include/cib/cib.hpp