Skip to content

Commit

Permalink
wip split build tool for example app
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrence-forooghian committed Aug 5, 2024
1 parent 3949857 commit 4ac78dd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,27 @@ jobs:
xcode-version: ${{ matrix.tooling.xcode-version }}

- name: Build and run tests
run: swift run BuildTool --platform ${{ matrix.platform }} --swift-version ${{ matrix.tooling.swift-version }}
run: swift run BuildTool build-and-test-library --platform ${{ matrix.platform }} --swift-version ${{ matrix.tooling.swift-version }}

check-example-app:
name: Example app, ${{matrix.platform}} (Xcode ${{ matrix.tooling.xcode-version }}, Swift ${{ matrix.tooling.swift-version }})
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
tooling:
- xcode-version: 15.3
swift-version: 5
- xcode-version: 16-beta
swift-version: 6
platform: [macOS, iOS, tvOS]

steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.tooling.xcode-version }}

- name: Build example app
run: swift run BuildTool build-example-app --platform ${{ matrix.platform }} --swift-version ${{ matrix.tooling.swift-version }}
9 changes: 7 additions & 2 deletions Sources/BuildTool/BuildTool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,17 @@ enum Error: Swift.Error {
case simulatorLookupFailed(message: String)
}

@main
// TODO: Is there a better way to make sure that this script has access to macOS APIs that are more recent than the package’s deployment target?
@available(macOS 14, *)
@main
struct BuildTool: ParsableCommand {
@Option var platform: Platform
static let configuration = CommandConfiguration(subcommands: [BuildAndTestLibrary.self])
}

// TODO: Is there a better way to make sure that this script has access to macOS APIs that are more recent than the package’s deployment target?
@available(macOS 14, *)
struct BuildAndTestLibrary: ParsableCommand {
@Option var platform: Platform
@Option var swiftVersion: Int

mutating func run() throws {
Expand Down

0 comments on commit 4ac78dd

Please sign in to comment.