Skip to content

Fix valgrind typo causing it to never be enabled #162

Fix valgrind typo causing it to never be enabled

Fix valgrind typo causing it to never be enabled #162

Workflow file for this run

name: threadpool
on:
push:
pull_request:
release:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "ubuntu-clang",
os: ubuntu-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja",
ccache: "ON",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-clang-valgrind",
os: ubuntu-latest,
build_type: "Debug",
cc: "clang",
cxx: "clang++",
generators: "Ninja",
ccache: "ON",
code_coverage: "OFF",
valgrind: "ON",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-codecoverage",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "OFF",
lsan: "OFF",
tsan: "OFF",
ubsan: "OFF",
code_coverage: "ON",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-asan",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "ON",
lsan: "OFF",
tsan: "OFF",
ubsan: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-lsan",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "OFF",
lsan: "ON",
tsan: "OFF",
ubsan: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-tsan",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "OFF",
lsan: "OFF",
tsan: "ON",
ubsan: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-ubsan",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "OFF",
lsan: "OFF",
tsan: "OFF",
ubsan: "ON",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "windows-msvc-vs2022",
os: windows-latest,
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
generators: "Visual Studio 17 2022",
ccache: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "windows-clang-ninja",
os: windows-latest,
build_type: "Release",
cc: "clang",
cxx: "clang",
generators: "Ninja",
ccache: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "macos-clang",
os: macos-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja",
ccache: "ON",
code_coverage: "OFF",
clang_format: "OFF",
}
steps:
- uses: actions/checkout@v5
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: ccache
if: startsWith(matrix.config.ccache, 'ON')
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.config.os }}-${{ matrix.config.build_type }}
max-size: 500M
- name: CPM Cache
id: cache-cpm
uses: actions/cache@v4
with:
path: .cpmcache
key: ${{ runner.os }}-cpm-${{ hashFiles('**/') }}
restore-keys: |
${{ runner.os }}-cpm-
- name: Add clang path to $PATH env on Windows
shell: bash
if: matrix.config.name == 'windows-clang-ninja'
run: |
echo "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin" >> $GITHUB_PATH
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '4.1.x'
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
ninja --version
cmake --version
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'ubuntu')
run: |
sudo apt-get install ninja-build
ninja --version
cmake --version
gcc --version
clang --version
- name: Install valgrind on ubuntu
if: matrix.config.valgrind == 'ON'
run: |
sudo apt-get install valgrind
valgrind --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
ninja --version
cmake --version
- name: Configure (CCACHE)
if: startsWith(matrix.config.ccache, 'ON')
shell: bash
run: |
mkdir build
mkdir instdir
export CC=${{ matrix.config.CC }}
export CXX=${{ matrix.config.CXX }}
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCPM_SOURCE_CACHE=.cpmcache/ \
-DTHREADPOOL_CI=ON \
-DTHREADPOOL_ASAN=${{ matrix.config.asan }} \
-DTHREADPOOL_LSAN=${{ matrix.config.lsan }} \
-DTHREADPOOL_TSAN=${{ matrix.config.tsan }} \
-DTHREADPOOL_UBSAN=${{ matrix.config.ubsan }} \
-DTHREADPOOL_CODE_COVERAGE=${{ matrix.config.code_coverage }} \
-DTHREADPOOL_VALGRIND=${{ matrix.config.valgrind }} \
-DTHREADPOOL_CLANG_FORMAT_CHECK=${{ matrix.config.clang_format }} \
-DTHREADPOOL_CLANG_FORMAT_FIX=${{ matrix.config.clang_format }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-G "${{ matrix.config.generators }}"
- name: Configure
if: startsWith(matrix.config.ccache, 'OFF')
shell: bash
run: |
mkdir build
mkdir instdir
export CC=${{ matrix.config.CC }}
export CXX=${{ matrix.config.CXX }}
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DCPM_SOURCE_CACHE=.cpmcache/ \
-DTHREADPOOL_CI=ON \
-DTHREADPOOL_ASAN=${{ matrix.config.asan }} \
-DTHREADPOOL_LSAN=${{ matrix.config.lsan }} \
-DTHREADPOOL_TSAN=${{ matrix.config.tsan }} \
-DTHREADPOOL_UBSAN=${{ matrix.config.ubsan }} \
-DTHREADPOOL_CODE_COVERAGE=${{ matrix.config.code_coverage }} \
-DTHREADPOOL_VALGRIND=${{ matrix.config.valgrind }} \
-DTHREADPOOL_CLANG_FORMAT_CHECK=${{ matrix.config.clang_format }} \
-DTHREADPOOL_CLANG_FORMAT_FIX=${{ matrix.config.clang_format }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-G "${{ matrix.config.generators }}"
- name: Build
shell: bash
run: cmake --build build --config ${{ matrix.config.build_type }}
- name: Install Strip
shell: bash
run: cmake --install build --strip --prefix=instdir
- name: Tests
shell: bash
working-directory: build
run: ctest --build-config ${{ matrix.config.build_type }} --output-on-failure --no-tests=error
if: always()
- name: Benchmarks
shell: bash
run: cmake --build build --config ${{ matrix.config.build_type }} --target threadpool_benchmarks_execute
if: always()
- name: Pack
shell: bash
working-directory: instdir
run: |
ls -laR
7z a ../${{ matrix.config.name }}.7z .
- name: Codecov
if: matrix.config.code_coverage == 'ON'
shell: bash
working-directory: build
run: |
mkdir lcov
wget -c https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15.tar.gz -O - | tar -xz -C lcov/
cd lcov/lcov-1.15
sudo make install
cd ../..
./lcov/lcov-1.15/bin/lcov --capture --directory . --output-file coverage.info
./lcov/lcov-1.15/bin/lcov --remove coverage.info '*/build/_deps/*' '*/tests/*' '*/examples/*' '*/benchmarks/*' '*/.ccache/*' '*/.cpmcache/*' '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info
./lcov/lcov-1.15/bin/lcov --list coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${{ secrets.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports"
- name: Upload Build Developer Logs
uses: actions/upload-artifact@v4
with:
name: 'z-${{ matrix.config.name }}-build_dev_logs'
path: |
./build/**/*.txt
./build/**/*.gcda
./build/**/*.gcno
./build/**/*codecov*
./build/**/*.xml
./build/**/*.cmake
./build/**/*.log
./build/**/*.json
./build/**/*.gcov
./build/**/*.info
./build/**/.*
!./build/_deps
retention-days: 1
- name: Upload
uses: actions/upload-artifact@v4
with:
path: ./${{ matrix.config.name }}.7z
name: ${{ matrix.config.name }}.7z
- name: Upload release asset
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ matrix.config.name }}.7z
asset_name: ${{ matrix.config.name }}.7z.zip
asset_content_type: application/zip
clang-format:
name: clang-format
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Formatting
uses: DoozyX/clang-format-lint-action@v0.20
with:
exclude: 'build instdir'
clangFormatVersion: 20
inplace: false
clang-tidy:
name: clang-tidy
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '4.1.x'
- name: Install dependencies on ubuntu
run: |
sudo apt-get install ninja-build
sudo apt-get install clang-tidy
ninja --version
cmake --version
gcc --version
clang --version
clang-tidy --version
- name: Configure
shell: bash
run: |
mkdir build
mkdir instdir
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCPM_SOURCE_CACHE=.cpmcache/ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DTHREADPOOL_CI=ON \
-DTHREADPOOL_CLANG_TIDY_CHECK=ON \
-G "Ninja"
- name: Build
shell: bash
run: cmake --build build --config Release --target threadpool_clang_tidy_check
cppcheck:
name: cppcheck
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '4.1.x'
- name: Install dependencies on ubuntu
run: |
sudo apt-get install ninja-build
sudo apt-get install cppcheck
ninja --version
cmake --version
gcc --version
clang --version
cppcheck --version
- name: Configure
shell: bash
run: |
mkdir build
mkdir instdir
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCPM_SOURCE_CACHE=.cpmcache/ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DTHREADPOOL_CI=ON \
-DTHREADPOOL_CPPCHECK=ON \
-G "Ninja"
- name: Build
shell: bash
run: cmake --build build --config Release --target threadpool_cppcheck