Skip to content

CI

CI #22

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Test (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
# Tests run only on macOS. Some tests download models from
# Hugging Face Hub, which requires URLSession. On Linux,
# FoundationNetworking crashes during URLSession teardown.
# See: https://github.com/swiftlang/swift-corelibs-foundation/issues/3675
- name: Run tests
run: swift test
build-linux:
name: Build (Linux)
runs-on: ubuntu-latest
container: swift:6.2.3
steps:
- uses: actions/checkout@v6
- name: Build
run: swift build
- name: Build tests
run: swift build --build-tests
lint:
name: Lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- run: swift format lint --strict --recursive .
- name: Suggest fixes (if check fails)
if: failure()
run: |
echo "### Here's how to fix the formatting locally:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo "# Format all Swift files" >> $GITHUB_STEP_SUMMARY
echo 'swift format -i --recursive .' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY