-
Notifications
You must be signed in to change notification settings - Fork 11
127 lines (120 loc) · 3.57 KB
/
Copy pathci.yml
File metadata and controls
127 lines (120 loc) · 3.57 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: CPP Semver CI
on:
push:
branches: [ '*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
jobs:
macos:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ macos-13 ]
build: [ Debug, Release ]
compiler: [ clang++ ]
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}}
env:
CXX: ${{matrix.compiler}}
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v4
- 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
linux:
runs-on: ${{matrix.platform.os}}
strategy:
fail-fast: false
matrix:
build: [ Debug, Release ]
platform:
- { os: "ubuntu-22.04", cxx: "g++-11", modules: "OFF" }
- { os: "ubuntu-22.04", cxx: "g++-12", modules: "OFF" }
- { os: "ubuntu-24.04", cxx: "g++-13", modules: "OFF" }
- { os: "ubuntu-24.04", cxx: "g++-14", modules: "ON" }
- { os: "ubuntu-22.04", cxx: "clang++-15", modules: "OFF" }
- { os: "ubuntu-24.04", cxx: "clang++-16", modules: "ON" }
name: ${{matrix.platform.os}} ${{matrix.platform.cxx}} ${{matrix.build}}
env:
CXX: ${{matrix.platform.cxx}}
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v4
- name: Install Ninja
run: sudo apt install ninja-build
- name: cmake
run: cmake -GNinja -S . -B build
-DCMAKE_BUILD_TYPE=${{matrix.build}}
-DSEMVER_BUILD_MODULE=${{matrix.platform.modules}}
- 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:
fail-fast: false
matrix:
build: [ Debug, Release ]
os: [ windows-latest ]
arch: [ Win32, x64 ]
modules: [ "OFF", "ON" ]
name: ${{matrix.os}} ${{matrix.arch}} ${{matrix.build}} ${{matrix.modules}}
env:
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v4
- name: cmake
run: cmake -S . -B build -A ${{matrix.arch}}
-DCMAKE_BUILD_TYPE=${{matrix.build}}
-DSEMVER_BUILD_MODULE=${{matrix.modules}}
- name: build
run: cmake --build build --config ${{matrix.build}} --parallel 4
- name: test
working-directory: build
run: ctest -C ${{matrix.build}} -j4
bazel:
runs-on: ubuntu-latest
name: Bazel
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.15.0
- name: test
run: bazel test :cpp-semver-tests
coverage:
needs: [ macos, linux, windows, bazel ]
runs-on: ubuntu-latest
env:
CTEST_OUTPUT_ON_FAILURE: 1
CXXFLAGS: "--coverage -fno-inline"
steps:
- uses: actions/checkout@v4
- 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 --keep-going
lcov -l cov.info
- name: codecov
working-directory: build
shell: bash
run: bash <(curl -s https://codecov.io/bash) -f cov.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}