Skip to content

Commit

Permalink
Update Package and modernize CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Nov 10, 2023
1 parent 0df82ad commit db7645f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,32 @@ on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'CODE_OF_CONDUCT.md'
- '.editorconfig'
- '.spi.yml'
pull_request:
branches:
- '**'
- main

env:
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer

jobs:
test:
name: Test
runs-on: macOS-latest
runs-on: macOS-13
strategy:
matrix:
destination:
- "platform=macOS"
- "platform=iOS Simulator,name=iPhone 11"
- "platform=iOS Simulator,name=iPhone 12"
- "platform=tvOS Simulator,name=Apple TV"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install XCBeautify
run: brew install xcbeautify
- name: Test platform ${{ matrix.destination }}
run: set -o pipefail && xcodebuild -scheme TextStory-Package -destination "${{ matrix.destination }}" test | xcpretty
run: set -o pipefail && xcodebuild -scheme TextStory-Package -destination "${{ matrix.destination }}" test | xcbeautify --renderer github-actions
24 changes: 15 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
// swift-tools-version:5.5
// swift-tools-version: 5.8

import PackageDescription

let settings: [SwiftSetting] = [
// .unsafeFlags(["-Xfrontend", "-strict-concurrency=complete"])
]

let package = Package(
name: "TextStory",
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13)],
Expand All @@ -15,12 +11,22 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/ChimeHQ/Rearrange", from: "1.5.0"),
.package(url: "https://github.com/mattmassicotte/MainOffender", from: "0.1.0"),
.package(url: "https://github.com/mattmassicotte/MainOffender", from: "0.1.0"),
],
targets: [
.target(name: "Internal", publicHeadersPath: "."),
.target(name: "TextStory", dependencies: ["Internal", "MainOffender", "Rearrange"], swiftSettings: settings),
.target(name: "TextStoryTesting", dependencies: ["TextStory"], swiftSettings: settings),
.testTarget(name: "TextStoryTests", dependencies: ["TextStory", "TextStoryTesting"], swiftSettings: settings),
.target(name: "TextStory", dependencies: ["Internal", "MainOffender", "Rearrange"]),
.target(name: "TextStoryTesting", dependencies: ["TextStory"]),
.testTarget(name: "TextStoryTests", dependencies: ["TextStory", "TextStoryTesting"]),
]
)

let swiftSettings: [SwiftSetting] = [
.enableExperimentalFeature("StrictConcurrency")
]

for target in package.targets {
var settings = target.swiftSettings ?? []
settings.append(contentsOf: swiftSettings)
target.swiftSettings = settings
}

0 comments on commit db7645f

Please sign in to comment.