-
Notifications
You must be signed in to change notification settings - Fork 41
155 lines (130 loc) · 4.75 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build and test QDLDL
on: [push, pull_request]
env:
# The CMake build type
BUILD_TYPE: Debug
jobs:
build:
strategy:
fail-fast: false
matrix:
# Use 24.04 explicitly to get newer GCC version
os: [ubuntu-24.04, macos-latest, windows-latest]
include:
- os: ubuntu-24.04
compiler: gcc
gcc: 14
extra_c_flags: "-fdiagnostics-format=sarif-file"
test_target: "test"
coverage: ON
analysis: ON
asan: ON
- os: macos-latest
extra_c_flags: ""
test_target: "test"
coverage: OFF
analysis: OFF
asan: OFF
- os: windows-latest
extra_c_flags: ""
test_target: "RUN_TESTS"
coverage: OFF
analysis: OFF
asan: OFF
runs-on: ${{ matrix.os }}
env:
QDLDL_BUILD_DIR_PREFIX: ${{ github.workspace }}/build
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
# - name: Setup Environment
# run: cmake -E make_directory $QDLDL_BUILD_DIR_PREFIX
- name: Configure
shell: bash
run: |
cmake -S ./ -B $QDLDL_BUILD_DIR_PREFIX \
--warn-uninitialized \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DQDLDL_UNITTESTS=ON \
-DQDLDL_DEV_COVERAGE=${{ matrix.coverage }} \
-DQDLDL_DEV_ANALYSIS=${{ matrix.analysis }} \
-DQDLDL_DEV_ASAN=${{ matrix.asan }} \
-DCMAKE_C_FLAGS=${{ matrix.extra_c_flags }}
- name: Build
shell: bash
run: cmake --build $QDLDL_BUILD_DIR_PREFIX --config $BUILD_TYPE
- name: Run tests
shell: bash
run: cmake --build $QDLDL_BUILD_DIR_PREFIX --target ${{ matrix.test_target }}
# Only parse and upload coverage if it was generated
- name: Process coverage
if: ${{ matrix.coverage == 'ON' }}
uses: imciner2/run-lcov@v1
with:
input_directory: ${{ github.workspace }}/build
exclude: '"$GITHUB_WORKSPACE/tests/*"'
output_file: '${{ github.workspace }}/build/coverage.info'
- name: Upload coverage
if: ${{ matrix.coverage == 'ON' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: '${{ github.workspace }}/build/coverage.info'
- name: "List dir"
if: ${{ matrix.analysis == 'ON' }}
shell: bash
run: ls -la ${{ github.workspace }}/build/
- name: Merge diagnostics
if: ${{ matrix.analysis == 'ON' }}
uses: microsoft/[email protected]
with:
# Command to be sent to SARIF Multitool
command: merge ${{ github.workspace }}/build/*.c.c.sarif --recurse true --output-directory=${{ github.workspace }}/build/ --output-file=gcc.sarif
- name: "List dir"
if: ${{ matrix.analysis == 'ON' }}
shell: bash
run: |
apt install tree
tree ${{ github.workspace }}/build/
- name: Upload diagnostics
if: ${{ matrix.analysis == 'ON' }}
uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: ${{ github.workspace }}/build/gcc.sarif
category: gcc
test_configs:
strategy:
fail-fast: false
matrix:
float: [ON, OFF]
long: [ON, OFF]
static: [ON, OFF]
shared: [ON, OFF]
# Only test the build configs on Linux
runs-on: ubuntu-latest
name: Config - FLOAT=${{ matrix.float }}, LONG=${{ matrix.long }}, SHARED=${{ matrix.shared }}, STATIC=${{ matrix.static }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Environment
run: cmake -E make_directory ${{ runner.workspace }}/build
- name: Configure
shell: bash
working-directory: ${{ runner.workspace }}/build
run: cmake --warn-uninitialized -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DQDLDL_BUILD_SHARED_LIB=${{ matrix.shared }} -DQDLDL_BUILD_STATIC_LIB=${{ matrix.static }} -DQDLDL_FLOAT=${{ matrix.float }} -DQDLDL_LONG=${{ matrix.long }} -DQDLDL_UNITTESTS=ON -DCOVERAGE=OFF $GITHUB_WORKSPACE
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build
run: cmake --build . --config $BUILD_TYPE
# The test suite requires the static library for linkage
- name: Run tests
if: ${{ matrix.static == 'ON' }}
shell: bash
working-directory: ${{ runner.workspace }}/build
run: ctest -C $BUILD_TYPE