macos build works in CI
This commit is contained in:
37
.github/workflows/main.yml
vendored
37
.github/workflows/main.yml
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user