1- name : Test
2-
1+ name : CI Tests
32on :
3+ workflow_dispatch :
44 push :
5- branches : [ main ]
5+ branches : [main]
66 pull_request :
7- branches : [ main ]
8-
7+ branches : [main]
98jobs :
109 build :
1110 name : ${{ matrix.config.name }}
1211 runs-on : ${{ matrix.config.os }}
13-
1412 strategy :
1513 fail-fast : false
16-
1714 matrix :
1815 config :
19- - {
20- name : " Ubuntu Clang 17" ,
21- os : ubuntu-24.04,
22- toolchain : " clang-17-toolchain.cmake" ,
23- clang_version : 17,
24- installed_clang_version : 14,
25- cmake_args : " -G \" Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\" RelWithDebInfo;Asan\" "
26- }
27-
28- - {
29- name : " Ubuntu Clang 18" ,
30- os : ubuntu-24.04,
31- toolchain : " clang-18-toolchain.cmake" ,
32- clang_version : 18,
33- installed_clang_version : 14,
34- cmake_args : " -G \" Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\" RelWithDebInfo;Asan\" "
35- }
36-
37- - {
38- name : " Ubuntu GCC 13" ,
39- os : ubuntu-24.04,
40- toolchain : " gcc-13-toolchain.cmake" ,
41- clang_version : 17,
42- installed_clang_version : 14,
43- cmake_args : " -G \" Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\" RelWithDebInfo;Asan\" "
44- }
45-
46- - {
47- name : " Ubuntu GCC 14" ,
48- os : ubuntu-24.04,
49- toolchain : " gcc-14-toolchain.cmake" ,
50- clang_version : 17,
51- installed_clang_version : 14,
52- cmake_args : " -G \" Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\" RelWithDebInfo;Asan\" "
53- }
16+ # Note: clang-19 + Asan setup causes errors on some platforms. Temporary skip some checks via .asan_options.
17+ - {name: "Ubuntu Clang 19", os: ubuntu-24.04, toolchain: "clang-19", clang_version: 19, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" ", asan_options: "new_delete_type_mismatch=0"}
18+ - {name: "Ubuntu Clang 18", os: ubuntu-24.04, toolchain: "clang-18", clang_version: 18, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
19+ - {name: "Ubuntu Clang 17", os: ubuntu-24.04, toolchain: "clang-17", clang_version: 17, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
20+ - {name: "Ubuntu GCC 14", os: ubuntu-24.04, toolchain: "gcc-14", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
21+ - {name: "Ubuntu GCC 13", os: ubuntu-24.04, toolchain: "gcc-13", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
22+ - {name: "Ubuntu GCC 12", os: ubuntu-24.04, toolchain: "gcc-12", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
5423
5524 steps :
5625 - uses : actions/checkout@v3
5726 with :
5827 submodules : ' true'
59-
6028 - uses : seanmiddleditch/gha-setup-ninja@master
61-
6229 - name : Activate verbose shell
6330 run : set -x
64-
6531 - name : Install LLVM+Clang
66- if : startsWith(matrix.config.os , 'ubuntu- ')
32+ if : startsWith(matrix.config.name , 'Ubuntu Clang ')
6733 run : |
6834 set -x
6935 cat /etc/lsb-release
70- sudo apt-get remove clang-${{matrix.config.installed_clang_version}} \
71- lldb-${{matrix.config.installed_clang_version}} \
72- lld-${{matrix.config.installed_clang_version}} \
36+ # Remove existing Clang installations.
37+ sudo apt-get remove \
38+ clang-${{matrix.config.installed_clang_version}} \
39+ clang++-${{matrix.config.installed_clang_version}} \
7340 clangd-${{matrix.config.installed_clang_version}} \
7441 clang-tidy-${{matrix.config.installed_clang_version}} \
7542 clang-format-${{matrix.config.installed_clang_version}} \
@@ -78,40 +45,52 @@ jobs:
7845 lld-${{matrix.config.installed_clang_version}} \
7946 lldb-${{matrix.config.installed_clang_version}} \
8047 llvm-${{matrix.config.installed_clang_version}}-tools \
81- libomp-${{matrix.config.installed_clang_version}}-dev \
8248 libc++-${{matrix.config.installed_clang_version}}-dev \
8349 libc++abi-${{matrix.config.installed_clang_version}}-dev \
8450 libclang-common-${{matrix.config.installed_clang_version}}-dev \
8551 libclang-${{matrix.config.installed_clang_version}}-dev \
8652 libclang-cpp${{matrix.config.installed_clang_version}}-dev \
87- libunwind-${{matrix.config.installed_clang_version}}-dev
53+ libomp-${{matrix.config.installed_clang_version}}-dev \
54+ libunwind-${{matrix.config.installed_clang_version}}-dev \
55+ libc++-dev libc++1 libc++abi-dev libc++abi1
56+ # Install LLVM+Clang.
57+ CLANG_VERSION=$(echo ${{matrix.config.toolchain}} | cut -d '-' -f2)
8858 wget https://apt.llvm.org/llvm.sh
8959 chmod +x llvm.sh
90- sudo ./llvm.sh ${{matrix.config.clang_version}} all
91- sudo apt-get install libc++-dev libc++1 libc++abi-dev libc++abi1
92-
93-
94- - name : Install GCC 14
95- if : matrix.config.name == 'Ubuntu GCC 14'
60+ sudo ./llvm.sh ${CLANG_VERSION} all
61+ # Link Clang libraries (if not done by llvm.sh - some links are already set).
62+ sudo ln -fs /usr/lib/llvm-${CLANG_VERSION}/lib/lib* /usr/lib/x86_64-linux-gnu/ || true
63+ # If Clang 17, install a newer version of libc++ and libc++abi.
64+ [[ ${CLANG_VERSION} = 17 ]] && sudo apt-get install libc++-dev libc++1 libc++abi-dev libc++abi1
65+ find /usr/lib/x86_64-linux-gnu/ -name libc++.so* || true
66+ clang++-${CLANG_VERSION} --version
67+ - name : Install GCC
68+ if : startsWith(matrix.config.name, 'Ubuntu GCC')
9669 run : |
70+ set -x
71+ # Remove existing GCC installations.
72+ sudo apt-get remove gcc-13 g++-13 gcc-14 g++-14 gcc g++
9773 sudo apt update
98- sudo apt-get install g++-14
99-
100-
101- - name : Configure
74+ # Install GCC.
75+ GCC_VERSION=$(echo ${{matrix.config.toolchain}} | cut -d '-' -f2)
76+ echo "GCC_VERSION=$GCC_VERSION"
77+ sudo apt-get install g++-${GCC_VERSION} gcc-${GCC_VERSION}
78+ find /usr/lib/x86_64-linux-gnu/ -name libstdc++.so*
79+ g++-${GCC_VERSION} --version
80+ - name : CMake Configure
10281 run : |
103- rm -rf .build
104- mkdir -p .build
105- cd .build
82+ set -x
10683 echo ${{ matrix.config.cmake_args }}
10784 echo ${{ matrix.config.toolchain }}
108- cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE=etc/${{ matrix.config.toolchain }} -B . -S ..
109-
110- - name : Build
85+ rm -rf .build
86+ cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE="etc/${{ matrix.config.toolchain }}-toolchain.cmake" -B .build -S .
87+ - name : CMake Build
11188 run : |
89+ set -x
11290 cmake --build .build --config Asan --target all -- -k 0
113-
114- - name : Test
91+ - name : CMake Test
11592 run : |
116- cd .build
117- ctest --output-on-failure
93+ set -x
94+ [[ ! -z "${{ matrix.config.asan_options }}" ]] && export ASAN_OPTIONS="${{ matrix.config.asan_options }}"
95+ ctest --build-config Asan --output-on-failure --test-dir .build
96+
0 commit comments