Skip to content

New measure of disorder: Amp #800

New measure of disorder: Amp

New measure of disorder: Amp #800

Workflow file for this run

# Copyright (c) 2020-2025 Morwenn
# SPDX-License-Identifier: MIT
name: Coverage Upload to Codecov
on:
push:
branches:
- 2.x.y-develop
- 2.x.y-stable
paths:
- '.github/workflows/code-coverage.yml'
- '.github/.codecov.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'include/**'
- 'tests/**'
jobs:
upload-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- name: Install LCOV
run: sudo apt-get install -y lcov
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}
run: >
cmake -S ${{github.event.repository.name}} -B build
-DCMAKE_BUILD_TYPE=Debug
-DCPPSORT_BUILD_TESTING=ON
-DCPPSORT_ENABLE_COVERAGE=ON
-DGENINFO_EXTRA_FLAGS="--ignore-errors mismatch,mismatch"
-DLCOV_EXTRA_FLAGS="--ignore-errors unused"
-G"Unix Makefiles"
- name: Build with coverage
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Debug -j 2
- name: Run the test suite
shell: bash
env:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
run: ctest -C Debug --no-tests=error
- name: Capture coverage info
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target lcov-capture
- name: Upload coverage info
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{runner.workspace}}/build/lcov/data
files: '*.info'
fail_ci_if_error: true