forked from z4kn4fein/cpp-semver
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (71 loc) · 2.08 KB
/
ci.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
name: CPP Semver CI
on: [push, pull_request]
jobs:
unix:
runs-on: ${{matrix.os}}
strategy:
matrix:
build: [Debug, Release]
os: [macos-latest, ubuntu-latest]
compiler: [g++, clang++]
flags: [-std=c++17, -std=c++2a]
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}} ${{matrix.flags}}
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: ${{ matrix.flags }}
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v3
- name: cmake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build}}
- name: build
run: cmake --build build --config ${{matrix.build}} --parallel 4
- name: test
working-directory: build
run: ctest -C ${{matrix.build}} -j4
windows:
runs-on: ${{matrix.os}}
strategy:
matrix:
build: [ Debug, Release ]
os: [ windows-2019, windows-latest ]
arch: [ Win32, x64 ]
flags: [ "/std:c++17", "/std:c++latest" ]
name: ${{matrix.os}} ${{matrix.arch}} ${{matrix.build}} ${{matrix.flags}}
env:
CXXFLAGS: ${{ matrix.flags }}
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v3
- name: cmake
run: cmake -S . -B build -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.build}}
- name: build
run: cmake --build build --config ${{matrix.build}} --parallel 4
- name: test
working-directory: build
run: ctest -C ${{matrix.build}} -j4
coverage:
needs: [ unix, windows ]
runs-on: ubuntu-latest
env:
CTEST_OUTPUT_ON_FAILURE: 1
CXXFLAGS: "--coverage -fno-inline"
steps:
- uses: actions/checkout@v3
- name: cmake
run: cmake -S . -B build
- name: build
run: cmake --build build --parallel 4
- name: test
working-directory: build
run: ctest -j4
- name: lcov
working-directory: build
run: |
sudo apt install lcov
lcov -c -d . -o cov.info
lcov -l cov.info
- name: codecov
working-directory: build
shell: bash
run: bash <(curl -s https://codecov.io/bash) -f cov.info