mirror of
https://github.com/aphrody-labs/opentui.git
synced 2026-10-13 21:08:53 +00:00
ci: test all packages on Windows in one job (#1557)
Each push started a Windows job for React, Solid, Keymap, QRCode and SSH. Each spent about a minute on setup for 3-11s of tests. Build and test them in one Windows job in Build Core instead. It gets the native library the same way as the core tests, and the required Core check now covers it.
This commit is contained in:
1 parent
aaefcc244f
commit
cbec2687c1
6 files changed
+91
-10
No files matched your search
@@ -257,6 +257,90 @@ jobs:
|
||||
with:
|
||||
name: crash-dumps-core-${{ matrix.os }}-${{ github.run_attempt }}
|
||||
|
||||
# Each package's Windows tests take seconds, and a Windows runner takes about a minute to set up, so
|
||||
# the packages share this job. Their own workflows test them on Linux and macOS.
|
||||
packages-windows:
|
||||
name: Test packages (Windows)
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
runs-on: blacksmith-8vcpu-windows-2025
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: 1.4.1
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Restore native host bottle
|
||||
id: bottle
|
||||
uses: ./.github/actions/restore-native-host-bottle
|
||||
with:
|
||||
zig-version: ${{ env.ZIG_VERSION }}
|
||||
|
||||
- name: Install native host bottle
|
||||
if: steps.bottle.outputs.cache-hit == 'true'
|
||||
run: bun scripts/native-bottle.ts package --hit true --zig "${{ env.ZIG_VERSION }}" --skip-symbols
|
||||
|
||||
- name: Wait for native libraries
|
||||
if: steps.bottle.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: bun scripts/wait-for-job.ts --name "Build Native Libraries"
|
||||
|
||||
- name: Download native artifacts
|
||||
if: steps.bottle.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: native-libraries
|
||||
path: packages/core/node_modules/@opentui/
|
||||
|
||||
- name: Build packages
|
||||
id: build
|
||||
run: |
|
||||
(cd packages/core && bun run build:lib)
|
||||
for package in react solid keymap; do (cd "packages/$package" && bun run build --ci); done
|
||||
for package in qrcode ssh; do (cd "packages/$package" && bun run build); done
|
||||
|
||||
# Run every package's tests even when an earlier package fails.
|
||||
- name: Typecheck SSH
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
working-directory: packages/ssh
|
||||
run: bun run typecheck
|
||||
|
||||
- name: Test React
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
working-directory: packages/react
|
||||
run: bun run test
|
||||
|
||||
- name: Test Solid
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
working-directory: packages/solid
|
||||
run: bun run test
|
||||
|
||||
- name: Test Keymap
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
working-directory: packages/keymap
|
||||
run: bun run test
|
||||
|
||||
- name: Test QRCode
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
working-directory: packages/qrcode
|
||||
run: bun run test
|
||||
|
||||
- name: Test SSH
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
working-directory: packages/ssh
|
||||
run: bun run test
|
||||
|
||||
bun-1-compat:
|
||||
name: Bun 1.3 compatibility
|
||||
needs: build
|
||||
@@ -293,13 +377,13 @@ jobs:
|
||||
# Gate job for branch protection
|
||||
build-complete:
|
||||
name: Core - Build and Test
|
||||
needs: [build, test, bun-1-compat]
|
||||
needs: [build, test, packages-windows, bun-1-compat]
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
if: always()
|
||||
steps:
|
||||
- name: Check test results
|
||||
run: |
|
||||
if [ "${{ needs.build.result }}" != "success" ] || [ "${{ needs.test.result }}" != "success" ] || [ "${{ needs['bun-1-compat'].result }}" != "success" ]; then
|
||||
if [ "${{ needs.build.result }}" != "success" ] || [ "${{ needs.test.result }}" != "success" ] || [ "${{ needs['packages-windows'].result }}" != "success" ] || [ "${{ needs['bun-1-compat'].result }}" != "success" ]; then
|
||||
echo "Tests failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [blacksmith-8vcpu-ubuntu-2404, blacksmith-8vcpu-windows-2025]
|
||||
os: [blacksmith-8vcpu-ubuntu-2404]
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [blacksmith-8vcpu-ubuntu-2404, blacksmith-8vcpu-windows-2025]
|
||||
os: [blacksmith-8vcpu-ubuntu-2404]
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [blacksmith-8vcpu-ubuntu-2404, blacksmith-8vcpu-windows-2025]
|
||||
os: [blacksmith-8vcpu-ubuntu-2404]
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [blacksmith-8vcpu-ubuntu-2404, blacksmith-8vcpu-windows-2025]
|
||||
os: [blacksmith-8vcpu-ubuntu-2404]
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [blacksmith-12vcpu-macos-15, blacksmith-8vcpu-ubuntu-2404, blacksmith-8vcpu-windows-2025]
|
||||
os: [blacksmith-12vcpu-macos-15, blacksmith-8vcpu-ubuntu-2404]
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
@@ -52,9 +52,6 @@ jobs:
|
||||
uses: mlugg/setup-zig@v2
|
||||
with:
|
||||
version: ${{ env.ZIG_VERSION }}
|
||||
# Keep Zig's cache path on the workspace drive, but do not restore/save
|
||||
# stale .zig-cache archives on Windows can contain missing cache files.
|
||||
use-cache: ${{ runner.os != 'Windows' }}
|
||||
cache-key: build-ssh
|
||||
|
||||
- name: Build core
|
||||
|
||||
Reference in new issue
Block a user