macos build works in CI

This commit is contained in:
geoffsee
2025-06-21 08:31:01 -04:00
parent 8e5d6fe5c8
commit 791eefaeec
4 changed files with 53 additions and 23 deletions

View File

@@ -10,13 +10,34 @@ env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
# Job for building on macOS (with Metal)
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build
- name: Run tests
run: cargo test
- uses: actions/checkout@v4
- name: Setup Python virtual environment
shell: bash
run: |
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install huggingface-hub
- name: Login to HuggingFace Hub
env:
HF_TOKEN: ${{ secrets.HUGGINGFACE_TOKEN }}
run: |
source .venv/bin/activate
if [ -n "$HF_TOKEN" ]; then
echo "Logging into Hugging Face Hub..."
huggingface-cli login --token $HF_TOKEN
else
echo "No HuggingFace token found, skipping login"
fi
- uses: oven-sh/setup-bun@v2
- run: bun install
- name: Build (macOS - Metal)
# The `metal` feature will be automatically picked up due to target_os = "macos" in Cargo.toml
run: cargo build --release
- name: Run tests (macOS)
run: cargo test