@@ -11,43 +11,49 @@ jobs:
11
11
strategy :
12
12
fail-fast : false
13
13
matrix :
14
- os : [ubuntu-latest, macos-latest, windows-latest]
14
+ # Use 24.04 explicitly to get newer GCC version
15
+ os : [ubuntu-24.04, macos-latest, windows-latest]
15
16
include :
16
- # Use 24.04 explicitly to get newer GCC version
17
17
- os : ubuntu-24.04
18
18
compiler : gcc
19
19
gcc : 14
20
20
extra_c_flags : " -fdiagnostics-format=sarif-file"
21
+ test_target : " test"
21
22
coverage : ON
22
23
analysis : ON
23
24
asan : ON
24
25
- os : macos-latest
25
26
extra_c_flags : " "
27
+ test_target : " test"
26
28
coverage : OFF
27
29
analysis : OFF
28
30
asan : OFF
29
31
- os : windows-latest
30
32
extra_c_flags : " "
33
+ test_target : " RUN_TESTS"
31
34
coverage : OFF
32
35
analysis : OFF
33
36
asan : OFF
34
37
35
38
runs-on : ${{ matrix.os }}
36
39
40
+ env :
41
+ QDLDL_BUILD_DIR_PREFIX : ${{ github.workspace }}/build
42
+ CTEST_OUTPUT_ON_FAILURE : 1
43
+
37
44
steps :
38
45
- name : Check out repository
39
46
uses : actions/checkout@v4
40
47
with :
41
48
submodules : ' recursive'
42
49
43
50
- name : Setup Environment
44
- run : cmake -E make_directory ${{ runner.workspace }}/build
51
+ run : cmake -E make_directory $QDLDL_BUILD_DIR_PREFIX
45
52
46
53
- name : Configure
47
54
shell : bash
48
- working-directory : ${{ runner.workspace }}/build
49
55
run : |
50
- cmake -S $GITHUB_WORKSPACE -B ${{ runner.workspace }}/build \
56
+ cmake -S ./ -B $QDLDL_BUILD_DIR_PREFIX \
51
57
--warn-uninitialized \
52
58
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
53
59
-DQDLDL_UNITTESTS=ON \
@@ -58,20 +64,18 @@ jobs:
58
64
59
65
- name : Build
60
66
shell : bash
61
- working-directory : ${{ runner.workspace }}/build
62
- run : cmake --build . --config $BUILD_TYPE
67
+ run : cmake --build $OSQP_BUILD_DIR_PREFIX --config $BUILD_TYPE
63
68
64
69
- name : Run tests
65
70
shell : bash
66
- working-directory : ${{ runner.workspace }}/build
67
- run : ctest -C $BUILD_TYPE
71
+ run : cmake --build $OSQP_BUILD_DIR_PREFIX --target ${{ matrix.test_target }}
68
72
69
73
# Only parse and upload coverage if it was generated
70
74
- name : Process coverage
71
75
if : ${{ matrix.coverage == 'ON' }}
72
76
uses : imciner2/run-lcov@v1
73
77
with :
74
- input_directory : ' ${{ runner .workspace }}/build'
78
+ input_directory : ${{ github .workspace }}/build
75
79
exclude : ' "$GITHUB_WORKSPACE/tests/*" "$GITHUB_WORKSPACE/examples/*" "/usr/include/x86_64-linux-gnu/bits/*"'
76
80
output_file : ' ${{ runner.workspace }}/build/coverage.info'
77
81
@@ -80,21 +84,21 @@ jobs:
80
84
uses : coverallsapp/github-action@master
81
85
with :
82
86
github-token : ${{ secrets.GITHUB_TOKEN }}
83
- path-to-lcov : ' ${{ runner .workspace }}/build/coverage.info'
87
+ path-to-lcov : ' ${{ github .workspace }}/build/coverage.info'
84
88
85
89
- name : Merge diagnostics
86
90
if : ${{ matrix.analysis == 'ON' }}
87
91
88
92
with :
89
93
# Command to be sent to SARIF Multitool
90
- command : ' merge ${{ runner .workspace }}/build/*.sarif --recurse true file.sarif --output-directory=${{ runner .workspace }}/build/ --output-file=gcc.sarif'
94
+ command : ' merge ${{ github .workspace }}/build/*.sarif --recurse true file.sarif --output-directory=${{ github .workspace }}/build/ --output-file=gcc.sarif'
91
95
92
96
- name : Upload diagnostics
93
97
if : ${{ matrix.analysis == 'ON' }}
94
98
uses : github/codeql-action/upload-sarif@v3
95
99
with :
96
100
# Path to SARIF file relative to the root of the repository
97
- sarif_file : ${{ runner .workspace }}/build/gcc.sarif
101
+ sarif_file : ${{ github .workspace }}/build/gcc.sarif
98
102
category : gcc
99
103
100
104
0 commit comments