64 lines
1.8 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# check:
# name: "check"
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# submodules: false
#
# - name: Setup Node environment
# uses: ./.github/actions/setup-node-env
#
# - name: Check types and lint and oxfmt
# run: pnpm check
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- runtime: node
command: pnpm canvas:a2ui:bundle && pnpm test
- runtime: bun
command: pnpm canvas:a2ui:bundle && bunx vitest run --config vitest.unit.config.ts
steps:
- name: Skip bun lane on push
if: github.event_name == 'push' && matrix.runtime == 'bun'
run: echo "Skipping bun test lane on push events."
- name: Checkout
if: github.event_name != 'push' || matrix.runtime != 'bun'
uses: actions/checkout@v4
with:
submodules: false
- name: Setup Node environment
if: matrix.runtime != 'bun' || github.event_name != 'push'
uses: ./.github/actions/setup-node-env
with:
install-bun: "${{ matrix.runtime == 'bun' }}"
- name: Configure Node test resources
if: matrix.runtime == 'node'
run: |
echo "OPENCLAW_TEST_WORKERS=2" >> "$GITHUB_ENV"
echo "OPENCLAW_TEST_MAX_OLD_SPACE_SIZE_MB=8192" >> "$GITHUB_ENV"
- name: Run tests (${{ matrix.runtime }})
if: github.event_name != 'push' || matrix.runtime != 'bun'
run: ${{ matrix.command }}