Skip to content

Commit 1fcb0ec

Browse files
committed
Split CI into a core matrix on every push and full UI builds on demand
1 parent 0c6be98 commit 1fcb0ec

4 files changed

Lines changed: 136 additions & 17 deletions

File tree

‎.github/workflows/core.yml‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: core
2+
3+
# The engine, the console tool and the tests on every push, on all three platforms,
4+
# without Slint — so without a Rust toolchain and without the 7–25 minute cargo build.
5+
# full.yml builds the UI. A change to takt4_core that breaks src/ui/ is therefore only
6+
# caught by full.yml's weekly run or a manual dispatch; run one before a milestone.
7+
8+
on:
9+
push:
10+
branches: [main]
11+
pull_request:
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
defaults:
22+
run:
23+
shell: bash
24+
25+
jobs:
26+
build:
27+
name: ${{ matrix.preset }}
28+
runs-on: ${{ matrix.os }}
29+
timeout-minutes: 30
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
# The hosted Windows images (windows-latest and windows-2025 alike, as of the
35+
# 2026-08-24 image) ship Visual Studio 2026 only. The preset names no
36+
# generator, so CMake picks whatever Visual Studio is installed.
37+
- os: windows-latest
38+
preset: windows-core
39+
cli: build/windows-core/bin/Release/takt4-cli.exe
40+
- os: macos-latest
41+
preset: macos-core
42+
cli: build/macos-core/bin/takt4-cli
43+
- os: ubuntu-24.04
44+
preset: linux-core
45+
cli: build/linux-core/bin/takt4-cli
46+
47+
steps:
48+
- uses: actions/checkout@v7
49+
with:
50+
submodules: recursive
51+
52+
- name: Install Linux packages
53+
if: runner.os == 'Linux'
54+
run: |
55+
sudo apt-get update
56+
sudo apt-get install -y --no-install-recommends \
57+
pkg-config libasound2-dev libjack-jackd2-dev
58+
59+
# The hosted images ship CMake and Ninja that satisfy the requirements in
60+
# README.md. Record what was actually used.
61+
- name: Toolchain versions
62+
run: |
63+
cmake --version
64+
ninja --version || true
65+
66+
- name: Configure
67+
run: cmake --preset ${{ matrix.preset }}
68+
69+
- name: Build
70+
run: cmake --build --preset ${{ matrix.preset }} --parallel
71+
72+
- name: Test
73+
run: ctest --preset ${{ matrix.preset }}
74+
75+
# The Windows and Linux runners have no audio devices; the macOS runner exposes
76+
# virtual CoreAudio ones, which the [hardware] test above opens. This proves the
77+
# console tool starts, brings PortAudio up with the expected host APIs, and copes
78+
# with an empty device list.
79+
- name: Console tool
80+
run: |
81+
${{ matrix.cli }} --version
82+
${{ matrix.cli }} devices
83+
84+
# Proves takt4_core stands without Slint or a Rust toolchain.
85+
- name: Slint was not fetched
86+
run: test ! -e build/${{ matrix.preset }}/_deps/slint-src
Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1-
name: build
1+
name: full
2+
3+
# The whole application, Slint included, on all three platforms. Every job builds
4+
# Slint from scratch through cargo (7–25 minutes, macOS billed at 10×), so this runs
5+
# only when something that can affect the UI build changes, once a week to catch
6+
# drift, and on demand. core.yml covers the engine on every push.
27

38
on:
49
push:
510
branches: [main]
11+
paths:
12+
- 'src/ui/**'
13+
- 'src/main.cpp'
14+
- 'src/CMakeLists.txt'
15+
- 'CMakeLists.txt'
16+
- 'CMakePresets.json'
17+
- 'cmake/**'
18+
- '.github/workflows/full.yml'
619
pull_request:
20+
paths:
21+
- 'src/ui/**'
22+
- 'src/main.cpp'
23+
- 'src/CMakeLists.txt'
24+
- 'CMakeLists.txt'
25+
- 'CMakePresets.json'
26+
- 'cmake/**'
27+
- '.github/workflows/full.yml'
28+
schedule:
29+
- cron: '0 6 * * 1' # Mondays, 06:00 UTC
730
workflow_dispatch:
831

932
permissions:
@@ -41,12 +64,6 @@ jobs:
4164
preset: linux
4265
app: build/linux/bin/takt4
4366
cli: build/linux/bin/takt4-cli
44-
# Engine and tests only. Proves takt4_core stands without Slint or a Rust
45-
# toolchain; the job checks that Slint was never even downloaded.
46-
- os: ubuntu-24.04
47-
preset: linux-core
48-
app: ""
49-
cli: build/linux-core/bin/takt4-cli
5067

5168
steps:
5269
- uses: actions/checkout@v7
@@ -79,18 +96,9 @@ jobs:
7996
run: ctest --preset ${{ matrix.preset }}
8097

8198
- name: Version banner
82-
if: matrix.app != ''
8399
run: ${{ matrix.app }} --version
84100

85-
# The Windows and Linux runners have no audio devices; the macOS runner exposes
86-
# virtual CoreAudio ones, which the [hardware] test above opens. This proves the
87-
# console tool starts, brings PortAudio up with the expected host APIs, and copes
88-
# with an empty device list.
89101
- name: Console tool
90102
run: |
91103
${{ matrix.cli }} --version
92104
${{ matrix.cli }} devices
93-
94-
- name: Slint was not fetched
95-
if: matrix.preset == 'linux-core'
96-
run: test ! -e build/linux-core/_deps/slint-src

‎CMakePresets.json‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@
3030
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" },
3131
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" }
3232
},
33+
{
34+
"name": "windows-core",
35+
"displayName": "Windows — engine and tests only (no Slint, no Rust toolchain needed)",
36+
"inherits": "windows-msvc",
37+
"cacheVariables": { "TAKT4_BUILD_UI": "OFF" }
38+
},
39+
{
40+
"name": "macos-core",
41+
"displayName": "macOS — engine and tests only (no Slint, no Rust toolchain needed)",
42+
"inherits": "macos",
43+
"cacheVariables": { "TAKT4_BUILD_UI": "OFF" }
44+
},
3345
{
3446
"name": "linux-core",
3547
"displayName": "Linux — engine and tests only (no Slint, no Rust toolchain needed)",
@@ -42,6 +54,8 @@
4254
{ "name": "windows-msvc-debug", "configurePreset": "windows-msvc", "configuration": "Debug" },
4355
{ "name": "macos", "configurePreset": "macos" },
4456
{ "name": "linux", "configurePreset": "linux" },
57+
{ "name": "windows-core", "configurePreset": "windows-core", "configuration": "Release" },
58+
{ "name": "macos-core", "configurePreset": "macos-core" },
4559
{ "name": "linux-core", "configurePreset": "linux-core" }
4660
],
4761
"testPresets": [
@@ -59,6 +73,13 @@
5973
},
6074
{ "name": "macos", "configurePreset": "macos", "output": { "outputOnFailure": true } },
6175
{ "name": "linux", "configurePreset": "linux", "output": { "outputOnFailure": true } },
76+
{
77+
"name": "windows-core",
78+
"configurePreset": "windows-core",
79+
"configuration": "Release",
80+
"output": { "outputOnFailure": true }
81+
},
82+
{ "name": "macos-core", "configurePreset": "macos-core", "output": { "outputOnFailure": true } },
6283
{ "name": "linux-core", "configurePreset": "linux-core", "output": { "outputOnFailure": true } }
6384
]
6485
}

‎README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ The build tree is `build/<preset>/`; the executable is `build/<preset>/bin/takt4
8484
generator on purpose: CMake picks the newest Visual Studio it knows and finds, x64, so
8585
the same preset serves a 2022 install and the 2026-only CI image.
8686

87+
CI (`.github/workflows/`) builds and tests the `*-core` presets on every push and the
88+
full presets with the UI weekly, on demand, and whenever `src/ui/`, `cmake/` or the
89+
CMake files change.
90+
8791
The UI is drawn by Slint's Skia renderer: Metal on macOS, OpenGL on Windows and Linux,
8892
falling back to Skia's software rasteriser when no GPU context can be created. Setting
8993
`SLINT_BACKEND=winit-skia-software` in the environment forces the software path, and
@@ -94,7 +98,7 @@ using on stderr. Skia is about 8 MB of the 18 MB Windows executable.
9498

9599
| Option | Default | Effect |
96100
|---|---|---|
97-
| `TAKT4_BUILD_UI` | `ON` | Build the Slint UI and the `takt4` executable. `OFF` builds the engine library, `takt4-cli` and the tests only, needs no Rust toolchain, and never fetches Slint. The `linux-core` preset sets this. |
101+
| `TAKT4_BUILD_UI` | `ON` | Build the Slint UI and the `takt4` executable. `OFF` builds the engine library, `takt4-cli` and the tests only, needs no Rust toolchain, and never fetches Slint. The `windows-core`, `macos-core` and `linux-core` presets set this. |
98102
| `TAKT4_BUILD_TESTS` | `ON` when top-level | Build the Catch2 test suite. |
99103
| `TAKT4_WARNINGS_AS_ERRORS` | `ON` | `/WX` or `-Werror` for takt4's own sources. Third-party code is compiled as system headers and is never subject to these flags. |
100104

0 commit comments

Comments
 (0)