mirror of
https://github.com/anomalyco/opentui.git
synced 2026-09-19 01:26:03 +08:00
152 lines
3.7 KiB
YAML
152 lines
3.7 KiB
YAML
name: Build Keymap
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
NODE_VERSION: 26.7.0
|
|
|
|
jobs:
|
|
test:
|
|
name: Test (${{ matrix.os }})
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [blacksmith-8vcpu-ubuntu-2404, blacksmith-8vcpu-windows-2025]
|
|
runs-on: ${{ matrix.os }}
|
|
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: Setup Zig
|
|
uses: mlugg/setup-zig@v2
|
|
with:
|
|
version: 0.16.0
|
|
use-cache: false
|
|
|
|
- name: Restore Zig cache
|
|
if: runner.os != 'Windows'
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: packages/native/.zig-cache
|
|
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
|
|
restore-keys: zig-v1-${{ runner.os }}-0.16.0-
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Build core
|
|
run: |
|
|
cd packages/core
|
|
bun run build:native --skip-symbols
|
|
bun run build:lib
|
|
|
|
- name: Build
|
|
run: |
|
|
cd packages/keymap
|
|
bun run build --ci
|
|
|
|
- name: Enable Linux core dumps
|
|
if: runner.os == 'Linux'
|
|
uses: ./.github/actions/enable-linux-coredumps
|
|
|
|
- name: Run tests
|
|
run: |
|
|
if [ "$(uname -s)" = Linux ]; then ulimit -c unlimited; fi
|
|
cd packages/keymap
|
|
bun run test
|
|
|
|
- name: Upload Linux core dumps
|
|
if: failure() && runner.os == 'Linux'
|
|
uses: ./.github/actions/upload-linux-coredumps
|
|
with:
|
|
name: crash-dumps-keymap-${{ matrix.os }}-${{ github.run_attempt }}
|
|
|
|
packed-consumer:
|
|
name: Packed Consumer Smoke
|
|
runs-on: blacksmith-8vcpu-ubuntu-2404
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.4.1
|
|
|
|
- name: Setup Zig
|
|
uses: mlugg/setup-zig@v2
|
|
with:
|
|
version: 0.16.0
|
|
use-cache: false
|
|
|
|
- name: Restore Zig cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: packages/native/.zig-cache
|
|
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
|
|
restore-keys: zig-v1-${{ runner.os }}-0.16.0-
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Build core
|
|
run: |
|
|
cd packages/core
|
|
bun run build
|
|
|
|
- name: Build keymap
|
|
run: |
|
|
cd packages/keymap
|
|
bun run build --ci
|
|
|
|
- name: Run packed consumer smoke test
|
|
run: |
|
|
cd packages/keymap
|
|
bun run test:dist --skip-build
|
|
|
|
build-complete:
|
|
name: Keymap - Build and Test
|
|
needs: [test, packed-consumer]
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
if: always()
|
|
steps:
|
|
- name: Check test results
|
|
run: |
|
|
if [ "${{ needs.test.result }}" != "success" ]; then
|
|
echo "Tests failed"
|
|
exit 1
|
|
fi
|
|
if [ "${{ needs.packed-consumer.result }}" != "success" ]; then
|
|
echo "Packed consumer smoke test failed"
|
|
exit 1
|
|
fi
|
|
echo "All tests passed"
|