CI and clang-tidy updates #142
Workflow file for this run
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: linux-ci | |
on: | |
push: | |
branches: [ master, main, develop ] | |
pull_request: | |
branches: [ master, main, develop ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
BUILD_TYPE: Release | |
ASAN_OPTIONS: "detect_leaks=0" | |
jobs: | |
ci: | |
runs-on: ubuntu-${{ matrix.os-release }} | |
strategy: | |
matrix: | |
include: | |
- build_type: 'Debug' | |
build_libs: 'shared' | |
compiler: 'gcc' | |
extra_args: '--coverage --tbb --num-tasks=64' | |
extra_packages: 'clang-tidy' | |
standard: '11' | |
os-release: '20.04' | |
- build_type: 'RelWithDebInfo' | |
build_libs: 'shared' | |
compiler: 'clang-12' | |
extra_args: '--num-tasks=256 --sanitizer --sanitizer-type=leak --static-analysis' | |
extra_packages: 'clang-tidy-12' | |
standard: '11' | |
os-release: '20.04' | |
- build_type: 'RelWithDebInfo' | |
build_libs: 'shared' | |
compiler: 'clang-12' | |
extra_args: '--num-tasks=256 --tbb --sanitizer --sanitizer-type=address --static-analysis' | |
extra_packages: 'clang-tidy-12' | |
standard: '14' | |
os-release: '20.04' | |
- build_type: 'RelWithDebInfo' | |
build_libs: 'shared' | |
compiler: 'clang-12' | |
extra_args: '--num-tasks=256 --tbb --sanitizer --sanitizer-type=thread --static-analysis' | |
extra_cmake: '-DPTL_USE_LOCKS=ON' | |
extra_ctest: '' | |
extra_packages: 'clang-tidy-12' | |
standard: '17' | |
os-release: '20.04' | |
exclude: | |
# Ubuntu 20.04 (Focal) | |
- os-release: '20.04' | |
compiler: 'gcc-12' | |
# Ubuntu 22.04 (Jammy) | |
- os-release: '22.04' | |
compiler: 'gcc-7' | |
- os-release: '22.04' | |
compiler: 'gcc-8' | |
- os-release: '22.04' | |
compiler: 'clang-7' | |
- os-release: '22.04' | |
compiler: 'clang-8' | |
- os-release: '22.04' | |
compiler: 'clang-10' | |
build_type: ['Release'] | |
build_libs: ['shared static'] | |
compiler: ['gcc-7', 'gcc-8', 'gcc-9', 'gcc-10', 'gcc-11', 'gcc-12', 'clang-7', 'clang-8', 'clang-10', 'clang-11', 'clang-12'] | |
extra_args: ['--num-tasks=256 --tbb'] | |
standard: ['11', '17'] | |
os-release: ['20.04', '22.04'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Conda | |
run: | |
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && | |
bash miniconda.sh -b -p /opt/conda && | |
export PATH="/opt/conda/bin:${PATH}" && | |
conda config --set always_yes yes --set changeps1 yes && | |
conda update -c defaults -n base conda && | |
conda create -n pyctest -c defaults -c conda-forge python=3.7 pyctest && | |
source activate && | |
conda activate pyctest | |
- name: Configure Repos | |
if: matrix.os-release == '20.04' | |
run: | |
DISTRIB_CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F '=' '{print $NF}') && | |
sudo apt-get update && | |
sudo apt-get install -y software-properties-common wget curl && | |
sudo add-apt-repository -u -y ppa:ubuntu-toolchain-r/test && | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && | |
echo "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-9 main" >> llvm-toolchain.list && | |
echo "deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-9 main" >> llvm-toolchain.list && | |
echo "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-10 main" >> llvm-toolchain.list && | |
echo "deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-10 main" >> llvm-toolchain.list && | |
echo "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-11 main" >> llvm-toolchain.list && | |
echo "deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-11 main" >> llvm-toolchain.list && | |
echo "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-12 main" >> llvm-toolchain.list && | |
echo "deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-12 main" >> llvm-toolchain.list && | |
cat llvm-toolchain.list && | |
sudo mv llvm-toolchain.list /etc/apt/sources.list.d/ | |
- name: Configure Repos | |
if: matrix.os-release == '22.04' | |
run: | |
sudo apt-get update && | |
sudo apt-get install -y software-properties-common wget curl && | |
sudo add-apt-repository -u -y ppa:ubuntu-toolchain-r/test | |
- name: Install Repos | |
run: | |
export CC=${{ matrix.compiler }} && | |
export CXX=$(echo "${{ matrix.compiler }}" | sed 's/gcc/g++/1' | sed 's/clang/clang++/1') && | |
echo "C compiler is ${CC}" && | |
echo "C++ compiler is ${CXX}" && | |
sudo apt-get update && | |
sudo apt-get install -y lcov libtbb-dev ${{ matrix.extra_packages }} && | |
sudo apt-get install -y build-essential ${CC} ${CXX} | |
- name: Build and Test | |
run: | |
export PATH="/opt/conda/bin:${PATH}" && | |
source activate && | |
conda activate pyctest && | |
export CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${CONDA_PREFIX}" && | |
export CC=$(which ${{ matrix.compiler }}) && | |
export CXX=$(which $(echo "${{ matrix.compiler }}" | sed 's/gcc/g++/1' | sed 's/clang/clang++/1')) && | |
echo "C compiler is ${CC}" && | |
echo "C++ compiler is ${CXX}" && | |
python ./pyctest-runner.py -SF | |
--pyctest-model=Continuous | |
--pyctest-site=GitHub-Linux | |
--pyctest-build-type=${{ matrix.build_type }} | |
--build-libs ${{ matrix.build_libs }} | |
${{ matrix.extra_args }} | |
-- -VV ${{ matrix.extra_ctest }} | |
-- -DCMAKE_INSTALL_PREFIX=${HOME}/ptl-install -DCMAKE_CXX_STANDARD=${{ matrix.standard }} ${{ matrix.extra_cmake }} | |
- name: Install | |
if: ${{ !contains(matrix.extra_args, 'sanitizer') }} | |
run: | |
export PATH="/opt/conda/bin:${PATH}" && | |
source activate && | |
conda activate pyctest && | |
export CMAKE_PREFIX_PATH="${HOME}/ptl-install:${CMAKE_PREFIX_PATH}:${CONDA_PREFIX}" && | |
cmake --build build-PTL --target install && | |
cmake -B ${HOME}/ptl-examples-build ${PWD}/examples && | |
cmake --build ${HOME}/ptl-examples-build --target all |