Skip to content

Allow multiple unique block-level attributes #3378

Allow multiple unique block-level attributes

Allow multiple unique block-level attributes #3378

Workflow file for this run

name: BAML Runtime
on:
pull_request:
branches:
- canary
push:
paths:
- "engine/**"
- ".github/workflows/primary.yml"
branches:
- canary
# need to run this periodically on the default branch to populate the build cache
schedule:
# daily at 2am PST
- cron: 0 10 * * *
merge_group:
types: [checks_requested]
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
repository-projects: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.12.0
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: |
typescript/**/pnpm-lock.yaml
- name: Install Node
run: pnpm install --frozen-lockfile
working-directory: typescript
- name: Check TS Lint
run: pnpm biome ci . --organize-imports-enabled=false
working-directory: typescript
test_node_generator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: |
engine/language_client_typescript/pnpm-lock.yaml
integ-tests/typescript/pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
- name: Install Node
run: pnpm install --frozen-lockfile
working-directory: engine/language_client_typescript
- name: Build Node
run: pnpm build:debug
working-directory: engine/language_client_typescript
- name: Install Node
run: pnpm install --frozen-lockfile
working-directory: integ-tests/typescript
- name: Test Node Generator
run: pnpm generate
working-directory: integ-tests/typescript
- name: Ensure No Changes
run: git diff --exit-code
- name: Test Node Generator (1 of 3)
run: pnpm generate
working-directory: integ-tests/typescript
- name: Ensure No Changes (1 of 3)
run: git diff --exit-code
- name: Test Node Generator (2 of 3)
run: pnpm generate
working-directory: integ-tests/typescript
- name: Ensure No Changes (2 of 3)
run: git diff --exit-code
- name: Test Node Generator (3 of 3)
run: pnpm generate
working-directory: integ-tests/typescript
- name: Ensure No Changes (3 of 3)
run: git diff --exit-code
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
- name: Test Rust
# skip doctests & integration tests (the latter require OPENAI_API_KEY and ANTHROPIC_API_KEY to be set)
run: cargo test --lib
working-directory: engine
build-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: rustup target add wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
- name: Build rust for wasm32
run: cargo build --target=wasm32-unknown-unknown
working-directory: engine/baml-schema-wasm
integ-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: astral-sh/setup-uv@v5
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
- name: run python tests
run: |
cd integ-tests/python
./run_tests.sh
build-cli:
if: github.event_name == 'release'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
- name: Build CLI
run: cargo build --release --bin baml-cli --target ${{ matrix.target }}
working-directory: engine
- name: Upload CLI artifact
uses: actions/upload-artifact@v4
with:
name: baml-cli-${{ matrix.target }}
path: engine/target/release/baml-cli*