Skip to content

Commit aefe864

Browse files
committed
Tweak CI
1 parent c287bcd commit aefe864

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

.github/workflows/ci.yml

+17-13
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,49 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
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]
1516
include:
16-
# Use 24.04 explicitly to get newer GCC version
1717
- os: ubuntu-24.04
1818
compiler: gcc
1919
gcc: 14
2020
extra_c_flags: "-fdiagnostics-format=sarif-file"
21+
test_target: "test"
2122
coverage: ON
2223
analysis: ON
2324
asan: ON
2425
- os: macos-latest
2526
extra_c_flags: ""
27+
test_target: "test"
2628
coverage: OFF
2729
analysis: OFF
2830
asan: OFF
2931
- os: windows-latest
3032
extra_c_flags: ""
33+
test_target: "RUN_TESTS"
3134
coverage: OFF
3235
analysis: OFF
3336
asan: OFF
3437

3538
runs-on: ${{ matrix.os }}
3639

40+
env:
41+
QDLDL_BUILD_DIR_PREFIX: ${{ github.workspace }}/build
42+
CTEST_OUTPUT_ON_FAILURE: 1
43+
3744
steps:
3845
- name: Check out repository
3946
uses: actions/checkout@v4
4047
with:
4148
submodules: 'recursive'
4249

4350
- name: Setup Environment
44-
run: cmake -E make_directory ${{ runner.workspace }}/build
51+
run: cmake -E make_directory $QDLDL_BUILD_DIR_PREFIX
4552

4653
- name: Configure
4754
shell: bash
48-
working-directory: ${{ runner.workspace }}/build
4955
run: |
50-
cmake -S $GITHUB_WORKSPACE -B ${{ runner.workspace }}/build \
56+
cmake -S ./ -B $QDLDL_BUILD_DIR_PREFIX \
5157
--warn-uninitialized \
5258
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
5359
-DQDLDL_UNITTESTS=ON \
@@ -58,20 +64,18 @@ jobs:
5864
5965
- name: Build
6066
shell: bash
61-
working-directory: ${{ runner.workspace }}/build
62-
run: cmake --build . --config $BUILD_TYPE
67+
run: cmake --build $QDLDL_BUILD_DIR_PREFIX --config $BUILD_TYPE
6368

6469
- name: Run tests
6570
shell: bash
66-
working-directory: ${{ runner.workspace }}/build
67-
run: ctest -C $BUILD_TYPE
71+
run: cmake --build $QDLDL_BUILD_DIR_PREFIX --target ${{ matrix.test_target }}
6872

6973
# Only parse and upload coverage if it was generated
7074
- name: Process coverage
7175
if: ${{ matrix.coverage == 'ON' }}
7276
uses: imciner2/run-lcov@v1
7377
with:
74-
input_directory: '${{ runner.workspace }}/build'
78+
input_directory: ${{ github.workspace }}/build
7579
exclude: '"$GITHUB_WORKSPACE/tests/*" "$GITHUB_WORKSPACE/examples/*" "/usr/include/x86_64-linux-gnu/bits/*"'
7680
output_file: '${{ runner.workspace }}/build/coverage.info'
7781

@@ -80,21 +84,21 @@ jobs:
8084
uses: coverallsapp/github-action@master
8185
with:
8286
github-token: ${{ secrets.GITHUB_TOKEN }}
83-
path-to-lcov: '${{ runner.workspace }}/build/coverage.info'
87+
path-to-lcov: '${{ github.workspace }}/build/coverage.info'
8488

8589
- name: Merge diagnostics
8690
if: ${{ matrix.analysis == 'ON' }}
8791
uses: microsoft/[email protected]
8892
with:
8993
# 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'
9195

9296
- name: Upload diagnostics
9397
if: ${{ matrix.analysis == 'ON' }}
9498
uses: github/codeql-action/upload-sarif@v3
9599
with:
96100
# 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
98102
category: gcc
99103

100104

0 commit comments

Comments
 (0)