Skip to content

[version] Bump rapidgzip version to 0.10.4 #191

[version] Bump rapidgzip version to 0.10.4

[version] Bump rapidgzip version to 0.10.4 #191

Workflow file for this run

name: C++ Code Checks
on:
push:
branches: [ "master" ]
pull_request:
workflow_dispatch:
jobs:
Code-Coverage:
name: Code Coverage
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install bzip2 cppcheck clang clang-tidy g++ lcov ninja-build wget gzip tabix pigz libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: System Information
run: |
nproc
cmake --version
g++ --version
clang++ --version
cppcheck --version
- name: Code Coverage
run: |
mkdir -p build-codeov && cd -- "$_"
# It should be compiled with the same g++ version as anylzed with gcov!
# If g++ --version and gcov --version print different versions, there might be problems when creating
# the coverage report, e.g., I had: "version 'A85*', prefer 'B12*'".
# It is possible to specify a different gcov version to lcov using, e.g., lcov --gcov-tool gcov-8.
# For me it compiled with g++-8 but used gcov-11 by default!
CXX=g++ CC=gcc cmake -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=ON ..
cmake --build . -- check
lcov --capture --directory . --base-directory "$( cd .. && pwd )" --no-external --output-file coverage.info
lcov --list coverage.info
bash <( wget -O- -q https://codecov.io/bash ) -f coverage.info
- name: Run cppcheck
# Crashes on templated variable REVERSED_BITS_LUT<T>[value] (internalAstError)
if: false
run: |
set -o pipefail
cppcheck -j $( nproc ) --enable=all --std=c++17 --suppress=unusedFunction --suppress=useStlAlgorithm \
-I src/core \
-I src/indexed_bzip2 \
-I src/rapidgzip \
-I src/rapidgzip/huffman \
src/benchmarks \
src/core \
src/indexed_bzip2 \
src/rapidgzip \
src/tests \
src/tools 2>&1 | tee cppcheck.log
if grep -E -i 'error: .* \[[^]]*\]$' cppcheck.log; then
echo -e '\e[31mThere were errors while running cppcheck!\e[0m'
exit 1
fi
Clang-Tidy:
name: Clang-Tidy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install clang clang-tidy ninja-build libarchive-dev zlib1g-dev nasm
- name: Run clang-tidy
run: |
mkdir -p build-compile-commands && cd -- "$_"
CC=clang CXX=clang++ cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DUSE_SYSTEM_ZLIB=ON
cd ..
set -o pipefail
run-clang-tidy -j $( nproc ) -p build-compile-commands | tee clang-tidy.log
if grep -E -i '(warning:|error:) .* \[[^]]*\]$' clang-tidy.log; then
echo -e '\e[31mThere were warnings or errors while running clang-tidy!\e[0m'
exit 1
fi
Check:
name: Check without Sanitizer
# And especially without -DSHORT_TESTS, which makes it non redundant to the sanitizer checks!
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install g++ ninja-build gzip tabix pigz libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Sanitizers
run: |
mkdir -p "build" && cd -- "$_"
CXX=g++ CC=gcc cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWITH_ISAL=1 ..
cmake --build . -- check
Check-Without-Isal:
name: Check without Sanitizer and without ISA-l
# And especially without -DSHORT_TESTS, which makes it non redundant to the sanitizer checks!
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install g++ ninja-build gzip tabix pigz libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Sanitizers
run: |
mkdir -p "build" && cd -- "$_"
CXX=g++ CC=gcc cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWITH_ISAL=0 ..
cmake --build . -- check
Asan:
name: ASan
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install clang g++ ninja-build gzip tabix pigz libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Sanitizers
run: |
for sanitized in address; do
(
mkdir -p "build-sanitized-$sanitized" && cd -- "$_"
CXX=clang++ CC=clang cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=$sanitized -DSHORT_TESTS" ..
cmake --build . -- check
)
done
UBSan:
name: UBSan
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install clang g++ ninja-build gzip tabix pigz libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Sanitizers
run: |
for sanitized in undefined; do
(
mkdir -p "build-sanitized-$sanitized" && cd -- "$_"
CXX=clang++ CC=clang cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=$sanitized -DSHORT_TESTS" ..
cmake --build . -- check
)
done
Safe-Stack:
name: Safe-Stack
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install clang ninja-build gzip tabix pigz libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Sanitizers
run: |
for sanitized in safe-stack; do
(
mkdir -p "build-sanitized-$sanitized" && cd -- "$_"
CXX=clang++ CC=clang cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=$sanitized -DSHORT_TESTS" ..
cmake --build . -- check
)
done
TSan:
name: TSan
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install clang g++ ninja-build gzip tabix pigz libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Thread Sanitizer
run: |
sanitized=thread
mkdir -p "build-sanitized-$sanitized" && cd -- "$_"
#
# TSAN in clang 10 and 11 shows false positives in condition variables:
# https://github.com/google/sanitizers/issues/1259
# Similar false positives appear with GCC 10.
# NO warnings appear with: GCC 8, 9 and clang 12,
# so I'm pretty sure that these are the referenced false positives.
clangMajorVersion=$( clang++ --version | sed -n -E 's|.* ([0-9]+)[.][0-9]+[.][0-9]+.*|\1|p' | head -1 )
if [[ ( "$sanitized" == thread ) && ( "$clangMajorVersion" -le 11 ) ]]; then
g++ --version
gccMajorVersion=$( g++ --version | sed -n -E 's|.* ([0-9]+)[.][0-9]+[.][0-9]+.*|\1|p' | head -1 )
if [[ "$gccMajorVersion" -ge 10 ]]; then
echo "Could not find a compiler version without known false positives. Skipping TSAN."
continue
fi
CXX=g++
CC=gcc
else
CXX=clang++
CC=clang
fi
export CC CXX
#
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=$sanitized -DSHORT_TESTS" ..
cmake --build . -- check
Code-Checks:
name: Check with Infer
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install ninja-build wget nasm
# Install infer
VERSION=1.1.0
wget -q -O- "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" | tar -xJ
echo "$PWD/infer-linux64-v$VERSION/bin" >> $GITHUB_PATH
- name: Run infer
run: |
mkdir -p build-compile-commands && cd -- "$_"
CC=clang CXX=clang++ cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
infer run --report-blacklist-path-regex '.*testParallelBitStringFinder.cpp' --compilation-database compile_commands.json
Ibzip2-Tests:
name: Ibzip2 Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get -y install bzip2 pbzip2 lbzip2 g++ ninja-build nasm
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade-strategy eager --upgrade cython build
- name: Install indexed_bzip2
working-directory: python/indexed_bzip2
shell: bash
run: |
python3 -m build
python3 -m pip install dist/*.tar.gz
- name: Run Standard Tests
# At this step, indexed_bzip2 should be installed.
run: |
mkdir -p build-ibzip2 && cd -- "$_"
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . -- ibzip2
set -o pipefail
bash ../src/tests/testIbzip2.sh | tee run-standard-tests.log
if grep -i 'failed' run-standard-tests.log; then
echo -e '\e[31mThere were errors while running the tests!\e[0m'
exit 1
fi