-
Notifications
You must be signed in to change notification settings - Fork 2.1k
76 lines (65 loc) · 2.1 KB
/
macos.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
name: macOS
on: [push, pull_request]
jobs:
build-macos:
name: AppleClang-C++${{matrix.std}}-${{matrix.build_type}}
runs-on: macos-12
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: true
matrix:
std: [14, 17, 20, 23]
include:
- generator: Xcode
- build_type: Debug
steps:
- uses: actions/checkout@v4
- name: Setup Dependencies
run: |
brew install ninja
- name: Setup Coverage Dependencies
if: matrix.build_type == 'Debug'
run: |
brew install gcovr
- name: Setup Environment
if: matrix.build_type == 'Debug'
run: |
echo 'CXXFLAGS=--coverage' >> $GITHUB_ENV
echo 'LDFLAGS=--coverage' >> $GITHUB_ENV
- name: Configure
shell: bash
env:
CXXFLAGS: -Wall -Wextra -Wsign-conversion -Wtautological-compare -Wformat-nonliteral -Wundef -Werror -pedantic-errors ${{env.CXXFLAGS}}
run: |
cmake -S . -B build_${{matrix.build_type}} \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-G "${{matrix.generator}}" \
-Werror
- name: Build
run: |
cmake --build build_${{matrix.build_type}} \
--config ${{matrix.build_type}}
- name: Test
run: |
ctest --test-dir build_${{matrix.build_type}} \
--build-config ${{matrix.build_type}} \
--output-on-failure
- name: Generate Coverage
if: matrix.build_type == 'Debug'
run: |
cd build_${{matrix.build_type}}
rm -r Tests/
gcovr -r .. . -s --cobertura coverage.xml
- name: Upload Coverage to Codecov
if: matrix.build_type == 'Debug'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build_${{matrix.build_type}}/coverage.xml
fail_ci_if_error: true
verbose: true