forked from jrmadsen/PTL
-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (126 loc) · 5.87 KB
/
linux-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: linux-ci
on:
push:
branches: [ master, main, develop, '*.x' ]
pull_request:
branches: [ master, main, develop, '*.x' ]
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: '22.04'
- build_type: 'RelWithDebInfo'
build_libs: 'shared'
compiler: 'clang-15'
extra_args: '--num-tasks=256 --sanitizer --sanitizer-type=leak --static-analysis'
extra_packages: 'clang-tidy-15'
standard: '11'
os-release: '22.04'
- build_type: 'RelWithDebInfo'
build_libs: 'shared'
compiler: 'clang-15'
extra_args: '--num-tasks=256 --tbb --sanitizer --sanitizer-type=address --static-analysis'
extra_packages: 'clang-tidy-15'
standard: '14'
os-release: '22.04'
- build_type: 'RelWithDebInfo'
build_libs: 'shared'
compiler: 'clang-15'
extra_args: '--num-tasks=256 --tbb --sanitizer --sanitizer-type=thread --static-analysis'
extra_cmake: '-DPTL_USE_LOCKS=ON'
extra_packages: 'clang-tidy-15'
standard: '17'
os-release: '22.04'
build_libs: ['shared static']
build_type: ['Release']
compiler: ['gcc-10', 'gcc-11', 'gcc-12', 'gcc-13', 'clang-13', 'clang-14', 'clang-15']
extra_args: ['--num-tasks=256 --tbb']
extra_ctest: ['']
os-release: ['22.04']
standard: ['11', '17']
steps:
- uses: actions/checkout@v2
- 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
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