From 7d93b43f9dc0e28d3a19f01a1327415170d7c33f Mon Sep 17 00:00:00 2001 From: Simon Klee Date: Wed, 4 Feb 2026 13:36:32 +0100 Subject: [PATCH 1/6] ci(core): run tests on both macOS and Linux Add matrix strategy for build core to run tests on ubuntu-latest in addition to macos-latest. --- .github/workflows/build-core.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml index d0b5704fe..289f24c17 100644 --- a/.github/workflows/build-core.yml +++ b/.github/workflows/build-core.yml @@ -7,8 +7,11 @@ on: jobs: build: - name: Core - Build and Test - runs-on: macos-latest + name: Core - Build and Test (${{ matrix.os }}) + strategy: + matrix: + os: [macos-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v4 From 802407f4ac1df9a13379f1e1608947d83badc571 Mon Sep 17 00:00:00 2001 From: Simon Klee Date: Wed, 4 Feb 2026 16:21:13 +0100 Subject: [PATCH 2/6] ci: add gate for all builds --- .github/workflows/build-core.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml index 289f24c17..aef7f0ccd 100644 --- a/.github/workflows/build-core.yml +++ b/.github/workflows/build-core.yml @@ -38,3 +38,17 @@ jobs: run: | cd packages/core bun run test + + build-complete: + name: Core - Build and Test + needs: build + runs-on: ubuntu-latest + if: always() + steps: + - name: Check build status + run: | + if [ "${{ needs.build.result }}" != "success" ]; then + echo "Build failed on one or more platforms" + exit 1 + fi + echo "All platform builds succeeded" From 5b7da52e9d144f620ac7c8eade8e997e3710ace8 Mon Sep 17 00:00:00 2001 From: Simon Klee Date: Wed, 4 Feb 2026 22:13:47 +0100 Subject: [PATCH 3/6] ci(core): restructure workflow to cross-compile and test in parallel Split the build workflow into three parallel jobs: cross-compiling native libraries once on macOS, running Zig native tests on more platforms, and running TypeScript tests with cross compiled artifacts. --- .github/workflows/build-core.yml | 108 +++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml index aef7f0ccd..6515b4820 100644 --- a/.github/workflows/build-core.yml +++ b/.github/workflows/build-core.yml @@ -5,12 +5,77 @@ on: pull_request: branches: [main] +env: + ZIG_VERSION: 0.15.2 + jobs: - build: - name: Core - Build and Test (${{ matrix.os }}) + # Cross-compile native libraries for all platforms + build-native: + name: Build Native Libraries + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Setup Zig + uses: goto-bus-stop/setup-zig@v2 + with: + version: ${{ env.ZIG_VERSION }} + + - name: Install dependencies + run: bun install + + - name: Build native libraries (cross-compile all platforms) + run: | + cd packages/core + bun run build:native --all + + - name: Upload native artifacts + uses: actions/upload-artifact@v4 + with: + name: native-libraries + path: packages/core/node_modules/@opentui/ + retention-days: 1 + + # Run Zig native tests (in parallel with build-native) + test-native: + name: Native Tests (${{ matrix.os }}) + strategy: + matrix: + os: [macos-latest, ubuntu-latest, ubuntu-24.04-arm64] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Zig + uses: goto-bus-stop/setup-zig@v2 + with: + version: ${{ env.ZIG_VERSION }} + + - name: Run native tests + run: | + cd packages/core/src/zig + zig build test --summary all + + # Run TypeScript tests with cross-compiled binaries + test-typescript: + name: TypeScript Tests (${{ matrix.os }}) + needs: build-native strategy: matrix: - os: [macos-latest, ubuntu-latest] + include: + - os: macos-latest + platform: darwin-arm64 + - os: ubuntu-latest + platform: linux-x64 + - os: ubuntu-24.04-arm64 + platform: linux-arm64 runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -24,31 +89,48 @@ jobs: - name: Setup Zig uses: goto-bus-stop/setup-zig@v2 with: - version: 0.15.2 + version: ${{ env.ZIG_VERSION }} - name: Install dependencies run: bun install - - name: Build + - name: Download native artifacts + uses: actions/download-artifact@v4 + with: + name: native-libraries + path: packages/core/node_modules/@opentui/ + + - name: Verify native library + run: | + echo "Checking for ${{ matrix.platform }} native library..." + ls -la packages/core/node_modules/@opentui/ + ls -la packages/core/node_modules/@opentui/core-${{ matrix.platform }}/ + + - name: Build TypeScript library run: | cd packages/core - bun run build + bun run build:lib - - name: Run tests + - name: Run TypeScript tests run: | cd packages/core - bun run test + bun run test:js + # Gate job for branch protection build-complete: name: Core - Build and Test - needs: build + needs: [test-native, test-typescript] runs-on: ubuntu-latest if: always() steps: - - name: Check build status + - name: Check test results run: | - if [ "${{ needs.build.result }}" != "success" ]; then - echo "Build failed on one or more platforms" + if [ "${{ needs.test-native.result }}" != "success" ]; then + echo "Native tests failed" + exit 1 + fi + if [ "${{ needs.test-typescript.result }}" != "success" ]; then + echo "TypeScript tests failed" exit 1 fi - echo "All platform builds succeeded" + echo "All tests passed" From 0dd61cfc9cf817a154d1967135bf067862c98439 Mon Sep 17 00:00:00 2001 From: Simon Klee Date: Wed, 4 Feb 2026 22:17:40 +0100 Subject: [PATCH 4/6] remove linux-arm64 from CI build matrix --- .github/workflows/build-core.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml index 6515b4820..44468f6cd 100644 --- a/.github/workflows/build-core.yml +++ b/.github/workflows/build-core.yml @@ -47,7 +47,7 @@ jobs: name: Native Tests (${{ matrix.os }}) strategy: matrix: - os: [macos-latest, ubuntu-latest, ubuntu-24.04-arm64] + os: [macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -74,8 +74,6 @@ jobs: platform: darwin-arm64 - os: ubuntu-latest platform: linux-x64 - - os: ubuntu-24.04-arm64 - platform: linux-arm64 runs-on: ${{ matrix.os }} steps: - name: Checkout code From acf4cc1711da4c92e65d22879e917d863d69ec0c Mon Sep 17 00:00:00 2001 From: Simon Klee Date: Wed, 4 Feb 2026 22:29:52 +0100 Subject: [PATCH 5/6] optimize slightly --- .github/workflows/build-core.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml index 44468f6cd..8863d5b37 100644 --- a/.github/workflows/build-core.yml +++ b/.github/workflows/build-core.yml @@ -35,6 +35,11 @@ jobs: cd packages/core bun run build:native --all + - name: Run native tests (darwin-arm64) + run: | + cd packages/core/src/zig + zig build test --summary all + - name: Upload native artifacts uses: actions/upload-artifact@v4 with: @@ -42,12 +47,12 @@ jobs: path: packages/core/node_modules/@opentui/ retention-days: 1 - # Run Zig native tests (in parallel with build-native) + # Run Zig native tests on Linux (macOS native tests run in build-native job) test-native: name: Native Tests (${{ matrix.os }}) strategy: matrix: - os: [macos-latest, ubuntu-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -84,11 +89,6 @@ jobs: with: bun-version: latest - - name: Setup Zig - uses: goto-bus-stop/setup-zig@v2 - with: - version: ${{ env.ZIG_VERSION }} - - name: Install dependencies run: bun install From 45bfa5d34a84ab431b34cdb5775fca5ec54832cb Mon Sep 17 00:00:00 2001 From: Simon Klee Date: Wed, 4 Feb 2026 22:40:31 +0100 Subject: [PATCH 6/6] ci: simplify some more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` build (macos-latest) ├── Cross-compile all platforms └── Upload artifacts │ ▼ test (matrix) ├── macos-latest (darwin-arm64) │ ├── Download artifacts │ ├── Run native tests │ └── Run TS tests │ └── ubuntu-latest (linux-x64) ├── Download artifacts ├── Run native tests └── Run TS tests │ ▼ build-complete (gate) ``` --- .github/workflows/build-core.yml | 56 ++++++++++---------------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml index 8863d5b37..ea1ba04fb 100644 --- a/.github/workflows/build-core.yml +++ b/.github/workflows/build-core.yml @@ -9,8 +9,7 @@ env: ZIG_VERSION: 0.15.2 jobs: - # Cross-compile native libraries for all platforms - build-native: + build: name: Build Native Libraries runs-on: macos-latest steps: @@ -35,11 +34,6 @@ jobs: cd packages/core bun run build:native --all - - name: Run native tests (darwin-arm64) - run: | - cd packages/core/src/zig - zig build test --summary all - - name: Upload native artifacts uses: actions/upload-artifact@v4 with: @@ -47,31 +41,9 @@ jobs: path: packages/core/node_modules/@opentui/ retention-days: 1 - # Run Zig native tests on Linux (macOS native tests run in build-native job) - test-native: - name: Native Tests (${{ matrix.os }}) - strategy: - matrix: - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Zig - uses: goto-bus-stop/setup-zig@v2 - with: - version: ${{ env.ZIG_VERSION }} - - - name: Run native tests - run: | - cd packages/core/src/zig - zig build test --summary all - - # Run TypeScript tests with cross-compiled binaries - test-typescript: - name: TypeScript Tests (${{ matrix.os }}) - needs: build-native + test: + name: Test (${{ matrix.os }}) + needs: build strategy: matrix: include: @@ -89,6 +61,11 @@ jobs: with: bun-version: latest + - name: Setup Zig + uses: goto-bus-stop/setup-zig@v2 + with: + version: ${{ env.ZIG_VERSION }} + - name: Install dependencies run: bun install @@ -104,6 +81,11 @@ jobs: ls -la packages/core/node_modules/@opentui/ ls -la packages/core/node_modules/@opentui/core-${{ matrix.platform }}/ + - name: Run native tests + run: | + cd packages/core/src/zig + zig build test --summary all + - name: Build TypeScript library run: | cd packages/core @@ -117,18 +99,14 @@ jobs: # Gate job for branch protection build-complete: name: Core - Build and Test - needs: [test-native, test-typescript] + needs: [test] runs-on: ubuntu-latest if: always() steps: - name: Check test results run: | - if [ "${{ needs.test-native.result }}" != "success" ]; then - echo "Native tests failed" - exit 1 - fi - if [ "${{ needs.test-typescript.result }}" != "success" ]; then - echo "TypeScript tests failed" + if [ "${{ needs.test.result }}" != "success" ]; then + echo "Tests failed" exit 1 fi echo "All tests passed"