chore: create ffi_macros crates #85
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Swift CI | |
on: | |
push: | |
paths: | |
- crates/algo_models_ffi/** | |
- crates/algo_models/** | |
- packages/swift/AlgoModels/** | |
- scripts/build/languages/swift.ts | |
- scripts/build/index.ts | |
- "!*.md" | |
- .github/workflows/swift_ci.yml | |
branches: | |
- main | |
- master | |
tags: | |
- "*" | |
pull_request: | |
paths: | |
- crates/algo_models_ffi/** | |
- crates/algo_models/** | |
- packages/swift/AlgoModels/** | |
- scripts/build/languages/swift.ts | |
- scripts/build/index.ts | |
- "!*.md" | |
- .github/workflows/swift_ci.yml | |
workflow_dispatch: | |
permissions: | |
contents: write | |
env: | |
CRATE: algo_models | |
PACKAGE: AlgoModels | |
jobs: | |
build_and_test: | |
defaults: | |
run: | |
shell: bash | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.82.0 | |
targets: aarch64-apple-ios, x86_64-apple-ios, aarch64-apple-ios-sim, x86_64-apple-ios, aarch64-apple-ios-macabi, x86_64-apple-ios-macabi, aarch64-apple-darwin, x86_64-apple-darwin | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Setup Xcode | |
uses: mxcl/xcodebuild@v3 | |
with: | |
swift: ^6 | |
action: none | |
platform: macOS | |
- name: Install iOS Simulator | |
run: xcodebuild -downloadPlatform iOS | |
- name: Build | |
run: bun scripts/build ${{ env.CRATE }} swift | |
# Ideally we'd use a matrix for the platforms, but due to the limitations of Mac runners on GitHub it's probably better to just have a single job with multiple steps | |
- name: Test (macOS) | |
run: cd packages/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=macOS" | |
- name: Test (iOS) | |
run: cd packages/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | |
- name: Test (Catalyst) | |
run: cd packages/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=macOS,variant=Mac Catalyst" | |
- name: Commit Package | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
if: github.event_name == 'push' | |
with: | |
commit_message: "Swift CI ${{ env.PACKAGE }} package" |