-
Notifications
You must be signed in to change notification settings - Fork 7
58 lines (48 loc) · 1.55 KB
/
ubuntu.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
name: Ubuntu
on:
push:
branches:
- main
pull_request:
jobs:
ubuntu-build:
name: Build on Ubuntu
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [g++-11, clang++-18]
buildmode: [Debug, Release]
steps:
- name: Checkout repository code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install cmake libssl-dev libcurl4-gnutls-dev ninja-build -y --no-install-recommends
- name: Install gcc
run: |
sudo apt install ${{matrix.compiler}} -y --no-install-recommends
# Temporary workaround for libasan bug stated here: https://github.com/google/sanitizers/issues/1716
sudo sysctl vm.mmap_rnd_bits=28
if: startsWith(matrix.compiler, 'g++')
- name: Install clang
run: |
CLANG_VERSION=$(echo ${{matrix.compiler}} | cut -d- -f2)
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${CLANG_VERSION}
if: startsWith(matrix.compiler, 'clang++')
- name: Configure CMake
shell: bash
run: cmake -S . -B build -GNinja
env:
CXX: ${{matrix.compiler}}
CMAKE_BUILD_TYPE: ${{matrix.buildmode}}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build .
- name: Tests
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -j 2 -C ${{matrix.buildmode}} --output-on-failure