44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
# Job for building on macOS (with Metal)
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- 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
|