-
Notifications
You must be signed in to change notification settings - Fork 40
93 lines (84 loc) · 3.86 KB
/
cmake.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
name: velocypack-test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
CXX_STANDARD: 20
SANITIZER: false
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# GCC builds
- {os: ubuntu-latest, compiler: gcc, version: '9',
build_type: Release, hash_type: xxhash }
- {os: ubuntu-latest, compiler: gcc, version: '10',
build_type: Release, hash_type: fasthash }
- {os: ubuntu-latest, compiler: gcc, version: '11',
build_type: Release, hash_type: xxhash }
- {os: ubuntu-latest, compiler: gcc, version: '10',
build_type: Debug, hash_type: xxhash,
flags: '-O0 -fno-inline --coverage', coverage: true}
- {os: ubuntu-latest, compiler: gcc, version: '10',
build_type: Debug, hash_type: xxhash,
flags: '-fsanitize=address -fno-omit-frame-pointer',
ld_flags: '-fsanitize=address -fno-omit-frame-pointer'}
# Clang builds
- {os: ubuntu-latest, compiler: clang, version: '10',
build_type: Release, hash_type: xxhash }
- {os: ubuntu-latest, compiler: clang, version: '11',
build_type: Release, hash_type: xxhash }
# Windows builds
- {os: windows-2019, compiler: msvc,
build_type: Release, hash_type: xxhash }
- {os: windows-latest, compiler: msvc,
build_type: Release, hash_type: xxhash }
# macOS builds
- {os: macos-latest, compiler: clang,
build_type: Release, hash_type: xxhash }
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install gcc
if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'gcc'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-${{ matrix.version }}
echo "CXX=g++-${{ matrix.version }}" >> ${GITHUB_ENV}
- name: Install clang
if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'clang'
run: |
export CODENAME=`lsb_release -c | sed 's/Codename:\t//'`
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${{ matrix.version }} main"
sudo apt-get update
sudo apt-get install clang-${{ matrix.version }}
echo "CC=clang-${{ matrix.version }}" >> ${GITHUB_ENV}
echo "CXX=clang++-${{ matrix.version }}" >> ${GITHUB_ENV}
echo "LDFLAGS=-fuse-ld=lld" >> ${GITHUB_ENV}
- name: Initialize MSVC ${{ matrix.version }}
if: startsWith(matrix.os, 'windows-')
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: ${{ matrix.version }}
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DHashType=${{ matrix.hash_type }} -DBuildTests=ON -DBuildLargeTests=OFF -DBuildVelocyPackExamples=ON -DBuildTools=ON -DEnableSSE=OFF -DCMAKE_CXX_STANDARD=${{env.CXX_STANDARD}} -DCMAKE_CXX_FLAGS="${{ matrix.flags }}" -DCMAKE_LINKER_FLAGS="${{ matrix.ld_flags }}"
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }}
- name: Test
working-directory: ${{github.workspace}}
run: scripts/travis-test.sh
- name: Coverage
if: matrix.coverage == true
run: |
sudo apt-get install lcov
scripts/gh-action-after-success.sh