Skip to content

Update version and improve macOS build configuration #271

Update version and improve macOS build configuration

Update version and improve macOS build configuration #271

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_TEST_THREADS: "1"
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/checkout@v4
- uses: dprint/[email protected]
- uses: pre-commit/[email protected]
build-macos:
strategy:
fail-fast: false
matrix:
os: [macos-15, macos-15-intel]
backend: [ruy, accelerate]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.backend }}
cache-on-failure: true
- uses: actions/cache@v4
with:
path: ~/.cache/huggingface
key: macos-test-data
- name: Build
run: cargo build -vv -p ct2rs --no-default-features -F "all-tokenizers,whisper,hub,${{ matrix.backend }}"
- name: Run tests
run: cargo test -vv -p ct2rs --no-default-features -F "all-tokenizers,whisper,hub,${{ matrix.backend }}" -- --include-ignored
build-linux:
strategy:
fail-fast: false
matrix:
backend: [ruy, mkl, openblas, dnnl]
runs-on: ubuntu-latest
env:
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.backend }}
cache-on-failure: true
- uses: actions/cache@v4
with:
path: ~/.cache/huggingface
key: linux-test-data
- name: Build
run: cargo build -vv -p ct2rs --no-default-features -F "all-tokenizers,whisper,hub,${{ matrix.backend }}"
- name: Run tests
run: cargo test -vv -p ct2rs --no-default-features -F "all-tokenizers,whisper,hub,${{ matrix.backend }}" -- --include-ignored
if: ${{ matrix.backend != 'mkl' }}
build-windows:
strategy:
fail-fast: false
matrix:
backend: [openblas, ruy, dnnl, mkl]
runs-on: windows-latest
steps:
- uses: actions/cache@v4
with:
path: C:/vcpkg/installed
key: cache-vcpkg-packages
- name: Install OpenBLAS
if: ${{ matrix.backend == 'openblas' }}
run: |
vcpkg install openblas:x64-windows-static
vcpkg integrate install
echo "CMAKE_INCLUDE_PATH=$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows-static/include/openblas;$env:CMAKE_INCLUDE_PATH" >> $env:GITHUB_ENV
echo "CMAKE_LIBRARY_PATH=$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows-static/lib;$env:CMAKE_LIBRARY_PATH" >> $env:GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.backend }}
cache-on-failure: true
- uses: actions/cache@v4
with:
path: ~/.cache/huggingface
key: windows-test-data
- name: Build
run: cargo build -vv -p ct2rs --no-default-features -F "all-tokenizers,whisper,hub,${{ matrix.backend }}"
- name: Run tests
run: cargo test -vv -p ct2rs --no-default-features -F "all-tokenizers,whisper,hub,${{ matrix.backend }}" -- --include-ignored
if: ${{ matrix.backend != 'mkl' }}
docs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: Swatinem/rust-cache@v2
- name: Build
run: |
cargo +nightly rustdoc -F whisper,hub -vv -p ct2rs -- --cfg docsrs
cargo +nightly rustdoc -F whisper,hub -vv -p ct2rs-platform -- --cfg docsrs