-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (69 loc) · 2.14 KB
/
linux.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
name: linux
on:
push:
branches: [ "main", "ci" ]
pull_request:
branches: [ "main", "ci" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
cxx: [g++-11, clang++-14]
build_type: [Debug, Release]
coverage: [OFF]
std: [17]
include:
- cxx: clang++-14
build_type: Debug
coverage: ON
std: 17
install: sudo apt-get install --no-install-recommends -y llvm-14 lcov
steps:
- uses: actions/checkout@v3
- name: Cache external dependencies
id: cache-deps
uses: actions/cache@v3
env:
cache-name: cache-deps
with:
path: ${{github.workspace}}/build/_deps
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup
run: |
${{matrix.install}}
- name: Configure
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
run: |
cmake -B ${{github.workspace}}/build\
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}\
-DCMAKE_CXX_STANDARD=${{matrix.std}}\
-DWEBXX_PEDANTIC=ON\
-DWEBXX_COVERAGE=${{matrix.coverage}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --rerun-failed --output-on-failure
- name: Gather coverage information
working-directory: ${{github.workspace}}/build
if: ${{ matrix.coverage == 'ON' }}
run: |
ln -s /usr/bin/llvm-cov-14 ${{github.workspace}}/build/gcov &&\
lcov --capture --directory .\
--gcov-tool ${{github.workspace}}/build/gcov\
--output-file ./coverage.info\
--include *webxx/include*
- name: Upload coverage to Codecov
if: ${{ matrix.coverage == 'ON' }}
uses: codecov/codecov-action@v3
with:
files: ${{github.workspace}}/build/coverage.info
fail_ci_if_error: true