Skip to content

build: add clang ci#214

Merged
egolearner merged 9 commits intomainfrom
add-clang-ci
Mar 23, 2026
Merged

build: add clang ci#214
egolearner merged 9 commits intomainfrom
add-clang-ci

Conversation

@egolearner
Copy link
Collaborator

@egolearner egolearner commented Mar 11, 2026

Greptile Summary

This PR adds a new Clang CI job for linux-x64 by introducing an optional compiler input to the reusable build workflow and a corresponding new pipeline job. The changes are well-scoped and the previously flagged missing OS guard on the Install Clang step has been correctly addressed.

Key changes:

  • 01-ci-pipeline.yml: Adds build-and-test-linux-x64-clang job that calls the reusable workflow with compiler: clang on ubuntu-24.04.
  • 03-macos-linux-build.yml: Adds optional compiler input (defaults to ''); installs clang and libomp-dev via apt on Linux when compiler == 'clang'; exports CC=clang / CXX=clang++ for the build steps.
  • The Install Clang step is correctly guarded with inputs.compiler == 'clang' && runner.os == 'Linux'.
  • Minor inconsistency: the env-var block that sets CC/CXX does not carry the same runner.os == 'Linux' guard, which could produce unexpected behaviour if the workflow is extended to macOS clang builds in the future.

Confidence Score: 4/5

  • Safe to merge; one minor style inconsistency around the OS guard on the compiler env-var block.
  • The core logic is correct and the previously raised critical issue (missing OS guard on the install step) has been fixed. The only remaining observation is a minor inconsistency where CC/CXX are set without a runner.os == 'Linux' guard, which does not affect the current job configuration but could silently misbehave if a future macOS clang job is added.
  • 03-macos-linux-build.yml — specifically the compiler env-var block at lines 74–77.

Important Files Changed

Filename Overview
.github/workflows/01-ci-pipeline.yml Adds a new build-and-test-linux-x64-clang job that calls the reusable build workflow with compiler: clang on ubuntu-24.04; straightforward and correct.
.github/workflows/03-macos-linux-build.yml Adds optional compiler input, installs Clang + libomp-dev on Linux when requested, and exports CC/CXX. The install step is correctly OS-guarded, but the env-var block that sets CC/CXX lacks the same guard, creating a minor inconsistency if the workflow is reused on macOS with compiler: clang.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([Push / PR / workflow_dispatch]) --> B[lint job]

    B --> C[build-and-test-macos-arm64\nmacos-15]
    B --> D[build-and-test-linux-arm64\nubuntu-24.04-arm]
    B --> E[build-and-test-linux-x64\nubuntu-24.04 / gcc]
    B --> F[build-and-test-linux-x64-clang\nubuntu-24.04 / clang ✨NEW]
    B --> G[build-android]

    subgraph reusable ["03-macos-linux-build.yml  (reusable)"]
        H[Checkout + Setup Python]
        H --> I{compiler == clang\n&& runner.os == Linux?}
        I -- yes --> J[apt install clang libomp-dev]
        I -- no --> K[Skip install]
        J --> L[Set up env vars\nCC=clang CXX=clang++]
        K --> L
        L --> M[pip install dependencies]
        M --> N[Build from source\npython -m pip install]
        N --> O[Run C++ Tests]
        O --> P[Run Python Tests]
        P --> Q[Run C++ Examples]
    end

    F --> reusable
    E --> reusable
    C --> reusable
    D --> reusable
Loading

Reviews (3): Last reviewed commit: "address comments" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@egolearner
Copy link
Collaborator Author

@greptile

richyreachy
richyreachy previously approved these changes Mar 20, 2026
@egolearner
Copy link
Collaborator Author

@Greptile

@egolearner egolearner merged commit 0489b8e into main Mar 23, 2026
11 checks passed
@egolearner egolearner deleted the add-clang-ci branch March 23, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants