Skip to content

Update Rust crate llama-cpp-2 to v0.1.151 #122

Update Rust crate llama-cpp-2 to v0.1.151

Update Rust crate llama-cpp-2 to v0.1.151 #122

name: karukan-engine CI
on:
push:
branches: [main]
paths:
- 'karukan-engine/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/karukan-engine-ci.yml'
pull_request:
branches: [main]
paths:
- 'karukan-engine/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/karukan-engine-ci.yml'
workflow_dispatch:
inputs:
run_integration_tests:
description: 'Run integration tests (requires model download)'
required: false
default: 'false'
type: boolean
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Run cargo check
run: cargo check -p karukan-engine --all-targets
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Run cargo clippy
run: cargo clippy -p karukan-engine --all-targets -- -D warnings
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt -p karukan-engine -- --check
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Run unit tests
run: cargo test -p karukan-engine --lib --bins
integration-test:
name: Integration Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_integration_tests == 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Cache HuggingFace models
uses: actions/cache@v4
with:
path: ~/.cache/huggingface
key: ${{ runner.os }}-hf-models-v1
- name: Run integration tests
run: cargo test -p karukan-engine --test kanji_conversion_tests -- --ignored
timeout-minutes: 30
build:
name: Build Release (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Build release
run: cargo build -p karukan-engine --release