Skip to content

Commit

Permalink
Tweak CI
Browse files Browse the repository at this point in the history
  • Loading branch information
imciner2 committed Jan 2, 2025
1 parent c287bcd commit b7b800c
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,49 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# Use 24.04 explicitly to get newer GCC version
os: [ubuntu-24.04, macos-latest, windows-latest]
include:
# Use 24.04 explicitly to get newer GCC version
- 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 ${{ runner.workspace }}/build
run: cmake -E make_directory $QDLDL_BUILD_DIR_PREFIX

- name: Configure
shell: bash
working-directory: ${{ runner.workspace }}/build
run: |
cmake -S $GITHUB_WORKSPACE -B ${{ runner.workspace }}/build \
cmake -S ./ -B $QDLDL_BUILD_DIR_PREFIX \
--warn-uninitialized \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DQDLDL_UNITTESTS=ON \
Expand All @@ -58,43 +64,41 @@ jobs:
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build
run: cmake --build . --config $BUILD_TYPE
run: cmake --build $QDLDL_BUILD_DIR_PREFIX --config $BUILD_TYPE

- name: Run tests
shell: bash
working-directory: ${{ runner.workspace }}/build
run: ctest -C $BUILD_TYPE
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: '${{ runner.workspace }}/build'
input_directory: ${{ github.workspace }}/build
exclude: '"$GITHUB_WORKSPACE/tests/*" "$GITHUB_WORKSPACE/examples/*" "/usr/include/x86_64-linux-gnu/bits/*"'
output_file: '${{ runner.workspace }}/build/coverage.info'
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: '${{ runner.workspace }}/build/coverage.info'
path-to-lcov: '${{ github.workspace }}/build/coverage.info'

- name: Merge diagnostics
if: ${{ matrix.analysis == 'ON' }}
uses: microsoft/[email protected]
with:
# Command to be sent to SARIF Multitool
command: 'merge ${{ runner.workspace }}/build/*.sarif --recurse true file.sarif --output-directory=${{ runner.workspace }}/build/ --output-file=gcc.sarif'
command: 'merge ${{ github.workspace }}/build/*.sarif --recurse true file.sarif --output-directory=${{ github.workspace }}/build/ --output-file=gcc.sarif'

- 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: ${{ runner.workspace }}/build/gcc.sarif
sarif_file: ${{ github.workspace }}/build/gcc.sarif
category: gcc


Expand Down

0 comments on commit b7b800c

Please sign in to comment.