[libc-commits] [libc] [llvm] Implement Automated Line and MC/DC Coverage CI Workflows (PR #219165)

Tom Stellard via libc-commits libc-commits at lists.llvm.org
Thu Sep 17 16:48:11 PDT 2026


================
@@ -0,0 +1,345 @@
+name: Libc Patch Coverage
+
+permissions:
+  contents: read
+
+on:
+  workflow_dispatch:
+  push:
+    branches:
+      - main
+    paths:
+      - 'libc/**'
+      - '.github/workflows/libc-patch-coverage.yml'
+      - '!libc/docs/**'
+      - '!libc/benchmarks/**'
+      - '!libc/fuzzing/**'
+      - '!**.md'
+  pull_request:
+    branches:
+      - main
+    paths:
+      - 'libc/**'
+      - '.github/workflows/libc-patch-coverage.yml'
+      - '!libc/docs/**'
+      - '!libc/benchmarks/**'
+      - '!libc/fuzzing/**'
+      - '!**.md'
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  pre-commit-coverage:
+    if: github.repository_owner == 'llvm'
+    timeout-minutes: 60
+    name: libc-patch-coverage (${{ matrix.name }})
+    runs-on: ubuntu-24.04
+    container:
+      image: ghcr.io/llvm/libc-ubuntu-24.04:latest at sha256:8fee4c9ce5a1fd095686593cd36e032c48a31b6ae575378c82accd1d86a08d59
+    defaults:
+      run:
+        shell: bash
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: Line Coverage
+            enable_mcdc: "OFF"
+            sccache_key: libc_patch_coverage_x86_64
+            artifact_name: libc-patch-coverage-report
+            report_title: "LLVM-libc Patch Coverage Report"
+          - name: MC/DC Coverage
+            enable_mcdc: "ON"
+            sccache_key: libc_patch_mcdc_coverage_x86_64
+            artifact_name: libc-patch-mcdc-coverage-report
+            report_title: "LLVM-libc Patch MC/DC Coverage Report"
+    steps:
+    - name: Checkout Code
+      uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
+      with:
+        ref: ${{ github.event.pull_request.head.sha || github.sha }}
+        fetch-depth: 100
+        persist-credentials: false
+
+    - name: Setup Compiler Cache (sccache)
+      uses: hendrikmuhs/ccache-action at d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
+      with:
+        max-size: 1G
+        key: ${{ matrix.sccache_key }}
+        variant: sccache
+
+    - name: Configure CMake
+      run: |
+        export CMAKE_FLAGS="
+          -G Ninja
+          -S runtimes
+          -B build-cov
+          -DCMAKE_C_COMPILER=clang-23
+          -DCMAKE_CXX_COMPILER=clang++-23
+          -DCMAKE_BUILD_TYPE=Debug
+          -DCMAKE_C_COMPILER_LAUNCHER=sccache
+          -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
+          -DLLVM_USE_LINKER=lld-23
+          -DLLVM_ENABLE_RUNTIMES=libc
+          -DLLVM_LIBC_FULL_BUILD=ON
+          -DLIBC_ENABLE_COVERAGE=ON
+          -DLIBC_ENABLE_COVERAGE_MCDC=${{ matrix.enable_mcdc }}
+          -DLIBC_TEST_SKIP_DEATH_TESTS=ON
+          -DLIBC_TEST_SKIP_SHARED_TESTS=ON
+        "
+        cmake $CMAKE_FLAGS
----------------
tstellar wrote:

Same question here.

https://github.com/llvm/llvm-project/pull/219165


More information about the libc-commits mailing list