Files
anomalyco__opentui/.github/workflows/build-react.yml
2026-09-04 21:09:49 +02:00

97 lines
2.3 KiB
YAML

name: Build React
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
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/react
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/react
bun run test
- name: Upload Linux core dumps
if: failure() && runner.os == 'Linux'
uses: ./.github/actions/upload-linux-coredumps
with:
name: crash-dumps-react-${{ matrix.os }}-${{ github.run_attempt }}
# Gate job for branch protection
build-complete:
name: React - Build and Test
needs: [test]
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
echo "All tests passed"