-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.47 KB
/
cmake-linux.yml
File metadata and controls
59 lines (52 loc) · 1.47 KB
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
name: Linux Build (GCC & Clang)
permissions:
contents: read
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "master" ]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
build_type: [Release]
shared: [ON, OFF]
include:
- compiler: gcc
c: gcc
cxx: g++
- compiler: clang
c: clang
cxx: clang++
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install compilers
run: |
sudo apt-get update
if [[ "${{ matrix.compiler }}" == "clang" ]]; then
sudo apt-get install -y clang
else
sudo apt-get install -y build-essential
fi
- name: Configure CMake (Linux)
run: >
cmake -B build
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_C_COMPILER=${{ matrix.c }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DPYRO_COMMON_BUILD_TESTS=ON
-DPYRO_COMMON_SHARED_LIBRARY=${{ matrix.shared }}
-S .
- name: Build (Linux)
run: cmake --build build --config ${{ matrix.build_type }} --parallel 4
- name: Run tests
working-directory: build
run: ctest --build-config ${{ matrix.build_type }}