-
Notifications
You must be signed in to change notification settings - Fork 5
125 lines (105 loc) · 3.37 KB
/
test-runner.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
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
name: Test Runner
on:
pull_request:
branches: [main]
run-name: "Test Runner - #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}"
env:
BUILD_TYPE: Debug
CMAKE_BUILD_DIRECTORY: build
defaults:
run:
shell: bash
jobs:
run-tests:
strategy:
matrix:
platform: [macos-latest, windows-latest]
include:
- platform: macos-latest
platform-name: macOS
package-manager: brew
additional-cmake-options: -DJIVE_ENABLE_COVERAGE=ON
- platform: windows-latest
platform-name: Windows
platform-shell: cmd
package-manager: choco
additional-cmake-options: -DCMAKE_PROGRAM_PATH="C:\ProgramData\chocolatey\lib\pluginval\tools"
name: Test ${{ matrix.platform-name }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install Ninja
run: ${{ matrix.package-manager }} install ninja
- name: Install pluginval
run: ${{matrix.package-manager}} install pluginval
- name: Setup devcmd
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: CMake Generate
run: |
cmake \
-B ${{ env.CMAKE_BUILD_DIRECTORY }} \
-G Ninja \
-D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-D JIVE_BUILD_TEST_RUNNER=ON \
-D JIVE_BUILD_DEMO_RUNNER=ON \
${{ matrix.additional-cmake-options }}
- name: CMake Build
run: |
cmake \
--build ${{ env.CMAKE_BUILD_DIRECTORY }} \
--config ${{ env.BUILD_TYPE }}
- name: Run CTest
run: |
cd ${{ env.CMAKE_BUILD_DIRECTORY }}
ctest \
--output-on-failure \
--extra-verbose \
-j14 \
-C ${{ env.BUILD_TYPE }} \
-T test \
-O ctest.log
- name: Install lcov
if: runner.os == 'macOS'
working-directory: ${{github.workspace}}/build
run: brew install lcov
- name: Generate Coverage Report
if: runner.os == 'macOS'
working-directory: ${{github.workspace}}/build
run: |
lcov \
--directory . \
--capture \
--output-file coverage.info \
--ignore-errors inconsistent \
--ignore-errors gcov \
--ignore-errors range \
--ignore-errors source
- name: Upload Coverage Report
if: runner.os == 'macOS'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./build/coverage.info
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Stage Artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.platform-name }} #${{ github.event.pull_request.number }}"
path: ${{ env.CMAKE_BUILD_DIRECTORY }}/ctest.log
if-no-files-found: ignore
retention-days: 7
overwrite: true
verify-formatting:
name: Verify Formatting
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: brew install clang-format
- name: Verify formatting
run: python3 .github/scripts/verify_formatting.py