Skip to content

Commit

Permalink
Build and test on macOS and iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mbernson committed Mar 2, 2024
1 parent fd713e7 commit 9c85a90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/BuildPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
xcode: [ Xcode_15.2 ]
os: [ macos-14 ]
runs-on: macos-14
steps:
- name: ls Xcode
run: ls -la /Applications/Xcode*
- name: Checkout
uses: actions/checkout@v4
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app
- name: Build project
run: swift build
- name: Test project
run: swift test
run: sudo xcode-select -s /Applications/Xcode_15.2.app
- name: Build and test on macOS
run: |
xcodebuild -scheme SwiftGit2 -destination "platform=macOS" build test
- name: Create iPhone Simuilator for testing
env:
SIMULATOR_NAME: "Custom Simulator"
DEVICE_ID: "com.apple.CoreSimulator.SimDeviceType.iPhone-15"
RUNTIME_ID: "com.apple.CoreSimulator.SimRuntime.iOS-17-2"
run: |
xcrun simctl create "$SIMULATOR_NAME" "$DEVICE_ID" "$RUNTIME_ID"
- name: Build and test on iOS
run: |
xcodebuild -scheme SwiftGit2 -destination "platform=iOS Simulator,name=iPhone 15,OS=17.2" build test
2 changes: 2 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import PackageDescription

let package = Package(
name: "SwiftGit2",
// This is necessary because the test dependencies explicitly specify these platform versions.
platforms: [.macOS(.v10_15), .iOS("15.5"), .tvOS(.v13), .visionOS(.v1)],
products: [
.library(
name: "SwiftGit2",
Expand Down

0 comments on commit 9c85a90

Please sign in to comment.