-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (88 loc) · 3.09 KB
/
Copy pathcmake.yml
File metadata and controls
112 lines (88 loc) · 3.09 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
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
name: Build and Test on Linux Mac and Windows
on:
push:
branches: [ master ]
tags: "v*"
env:
BUILD_TYPE: Debug
jobs:
build:
name: Test on ${{ matrix.config.os }} with ${{ matrix.config.cc }}
runs-on: ${{ matrix.config.os }}
env:
CC: ${{ matrix.config.cc }}
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-24.04, cc: "gcc", cxx: "g++"}
- {os: ubuntu-24.04, cc: "clang", cxx: "clang++"}
- {os: ubuntu-24.04-arm, cc: "gcc", cxx: "g++"}
- {os: ubuntu-24.04-arm, cc: "clang", cxx: "clang++"}
- {os: windows-latest, cc: "cl", cxx: "cl"}
steps:
- uses: actions/checkout@v6
- name: Prints
shell: bash
run: |
echo ${{ matrix.config.cc }}
echo ${{ matrix.config.os }}
${{ matrix.config.cc }} --version 2>&1 || ${{ matrix.config.cc }} 2>&1 || true
- name: Info
run: echo ${{ github.ref }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
coverage:
name: Coverage on ubuntu-24.04 with gcc
runs-on: ubuntu-24.04
needs: build
env:
CC: gcc
CXX: g++
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: sudo apt install libtbb-dev lcov
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWITH_COVERAGE=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
- name: Generate Coverage
run: |
lcov -c --directory ${{github.workspace}}/build --output-file ${{github.workspace}}/build/coverage.info
lcov --remove ${{github.workspace}}/build/coverage.info '/usr/*' --output-file ${{github.workspace}}/build/coverage.info
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{github.workspace}}/build/coverage.info
musl:
name: Test on Alpine Linux (musl)
runs-on: ubuntu-24.04
container:
image: alpine:latest
options: --volume /sys/kernel/tracing:/sys/kernel/tracing:ro
timeout-minutes: 5
steps:
- name: Install dependencies
run: apk add --no-cache git cmake g++ make linux-headers
- uses: actions/checkout@v6
- name: Prints
run: g++ --version
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug
- name: Build
run: cmake --build build
- name: Test
working-directory: build
run: ctest --output-on-failure