Skip to content

Commit ef7a140

Browse files
author
scc
committed
ci: Split CI into per-compiler workflows with separate badges
Replace single ci.yml with reusable build.yml called by msvc.yml, gcc.yml, clang.yml, apple-clang.yml. Each workflow gets its own GitHub Actions badge in the README. Update README with roadmap, Mermaid architecture diagram, and per-compiler status table.
1 parent cb68e8d commit ef7a140

7 files changed

Lines changed: 463 additions & 185 deletions

File tree

.github/workflows/apple-clang.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Apple Clang
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
apple-clang:
11+
uses: ./.github/workflows/build.yml
12+
with:
13+
os: macos-latest
14+
generator: Ninja
15+
cmake_args: "-DCMAKE_BUILD_TYPE=Debug"

.github/workflows/build.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Reusable build workflow — called by per-compiler CI workflows.
2+
name: Build
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
os:
8+
required: true
9+
type: string
10+
generator:
11+
required: true
12+
type: string
13+
cmake_args:
14+
required: false
15+
type: string
16+
default: ""
17+
build_args:
18+
required: false
19+
type: string
20+
default: ""
21+
test_args:
22+
required: false
23+
type: string
24+
default: ""
25+
26+
jobs:
27+
build:
28+
runs-on: ${{ inputs.os }}
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 1
34+
35+
# ── Cache submodules ──
36+
- name: Compute submodule cache key
37+
id: submod-hash
38+
shell: bash
39+
run: |
40+
echo "hash=$(git ls-tree HEAD third_party common/crypto | git hash-object --stdin)" >> "$GITHUB_OUTPUT"
41+
42+
- name: Cache submodules
43+
id: cache-submodules
44+
uses: actions/cache@v4
45+
with:
46+
path: |
47+
third_party
48+
common/crypto
49+
key: submodules-${{ runner.os }}-${{ steps.submod-hash.outputs.hash }}
50+
51+
- name: Init submodules
52+
if: steps.cache-submodules.outputs.cache-hit != 'true'
53+
run: git submodule update --init --recursive --depth 1
54+
55+
# ── Cache CPM downloads ──
56+
- name: Cache CPM
57+
uses: actions/cache@v4
58+
with:
59+
path: build/_deps
60+
key: cpm-${{ runner.os }}-${{ inputs.generator }}-${{ hashFiles('CMakeLists.txt', 'sdk/src/CMakeLists.txt') }}
61+
restore-keys: |
62+
cpm-${{ runner.os }}-${{ inputs.generator }}-
63+
64+
# ── Install Ninja ──
65+
- name: Install Ninja (Linux)
66+
if: runner.os == 'Linux'
67+
run: sudo apt-get update && sudo apt-get install -y ninja-build
68+
69+
- name: Install Ninja (macOS)
70+
if: runner.os == 'macOS'
71+
run: brew install ninja
72+
73+
# ── Configure ──
74+
- name: Configure
75+
shell: bash
76+
run: |
77+
cmake -B build \
78+
-G "${{ inputs.generator }}" \
79+
${{ inputs.cmake_args }} \
80+
-DENABLE_TESTS=ON
81+
82+
# ── Build ──
83+
- name: Build
84+
run: cmake --build build ${{ inputs.build_args }} -j
85+
86+
# ── Test ──
87+
- name: Test
88+
run: ctest --test-dir build ${{ inputs.test_args }} --output-on-failure

.github/workflows/ci.yml

Lines changed: 0 additions & 113 deletions
This file was deleted.

.github/workflows/clang.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Clang
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
clang:
11+
uses: ./.github/workflows/build.yml
12+
with:
13+
os: ubuntu-latest
14+
generator: Ninja
15+
cmake_args: >-
16+
-DCMAKE_BUILD_TYPE=Debug
17+
-DCMAKE_C_COMPILER=clang-18
18+
-DCMAKE_CXX_COMPILER=clang++-18

.github/workflows/gcc.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: GCC
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
gcc:
11+
uses: ./.github/workflows/build.yml
12+
with:
13+
os: ubuntu-latest
14+
generator: Ninja
15+
cmake_args: >-
16+
-DCMAKE_BUILD_TYPE=Debug
17+
-DCMAKE_C_COMPILER=gcc-14
18+
-DCMAKE_CXX_COMPILER=g++-14

.github/workflows/msvc.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: MSVC
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
msvc:
11+
uses: ./.github/workflows/build.yml
12+
with:
13+
os: windows-latest
14+
generator: "Visual Studio 17 2022"
15+
cmake_args: "-A x64"
16+
build_args: "--config Debug"
17+
test_args: "-C Debug"

0 commit comments

Comments
 (0)