-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (53 loc) · 1.86 KB
/
swift_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Swift CI
on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- master
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.85.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"