Skip to content

Commit 5b9e42d

Browse files
Updating action workflows (#59)
1 parent 0f80215 commit 5b9e42d

File tree

2 files changed

+62
-42
lines changed

2 files changed

+62
-42
lines changed

.github/workflows/unit-tests.yml

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323

2424
jobs:
2525
swift_tests_latest:
26-
name: Latest Swift Version
26+
name: Latest Swift
2727
runs-on: macos-15
2828
steps:
2929
- uses: maxim-lobanov/setup-xcode@v1
@@ -41,54 +41,25 @@ jobs:
4141
- name: Run tests
4242
run: swift test
4343
swift_tests_previous:
44-
name: Swift Version ${{ matrix.swift }}
45-
strategy:
46-
matrix:
47-
os: [macos-13]
48-
swift: ["5.9", "5.8"]
49-
runs-on: ${{ matrix.os }}
44+
name: Swift 5.10
45+
runs-on: macos-14
5046
steps:
51-
- uses: swift-actions/setup-swift@v1
52-
with:
53-
swift-version: ${{ matrix.swift }}
5447
- uses: maxim-lobanov/setup-xcode@v1
5548
with:
56-
xcode-version: "14.3.1"
49+
xcode-version: "15.0"
5750
- uses: actions/checkout@v3
5851
- uses: actions/cache@v3
5952
with:
6053
path: .build
61-
key: ${{ matrix.os }}-${{ matrix.swift }}-spm-${{ hashFiles('**/Package.resolved') }}
54+
key: macos-14-swift-510-spm-${{ hashFiles('**/Package.resolved') }}
6255
restore-keys: |
63-
${{ matrix.os }}-spm-
56+
macos-14-swift-510-spm-
6457
- name: Build
6558
run: swift build
6659
- name: Run tests
6760
run: swift test
68-
69-
ios_tests_latest:
70-
name: iOS Unit Tests - Latest Swift
71-
runs-on: macos-15
72-
steps:
73-
- uses: maxim-lobanov/setup-xcode@v1
74-
with:
75-
xcode-version: "16.0"
76-
- uses: actions/checkout@v3
77-
- uses: actions/cache@v3
78-
with:
79-
path: .build
80-
key: macos-15-spm-${{ hashFiles('**/Package.resolved') }}
81-
restore-keys: |
82-
macos-15-spm-
83-
84-
- name: Build
85-
run: xcodebuild build -scheme SyntaxSparrow -destination "OS=18.1,name=iPhone 16"
86-
87-
- name: Test
88-
run: xcodebuild test -scheme SyntaxSparrow -destination "OS=18.1,name=iPhone 16" -enableCodeCoverage YES
89-
90-
ios_tests_previous:
91-
name: iOS Unit Tests
61+
swift_tests_legacy:
62+
name: Swift ${{ matrix.swift }}
9263
strategy:
9364
matrix:
9465
os: [macos-13]
@@ -98,16 +69,17 @@ jobs:
9869
- uses: swift-actions/setup-swift@v1
9970
with:
10071
swift-version: ${{ matrix.swift }}
72+
- uses: maxim-lobanov/setup-xcode@v1
73+
with:
74+
xcode-version: "14.3.1"
10175
- uses: actions/checkout@v3
10276
- uses: actions/cache@v3
10377
with:
10478
path: .build
10579
key: ${{ matrix.os }}-${{ matrix.swift }}-spm-${{ hashFiles('**/Package.resolved') }}
10680
restore-keys: |
10781
${{ matrix.os }}-spm-
108-
10982
- name: Build
110-
run: xcodebuild build -scheme SyntaxSparrow -destination "OS=17.2,name=iPhone 13"
111-
112-
- name: Test
113-
run: xcodebuild test-without-building -scheme SyntaxSparrow -destination "name=iPhone 13" -enableCodeCoverage YES
83+
run: swift build
84+
- name: Run tests
85+
run: swift test

Package@swift-5.10.swift

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// swift-tools-version: 5.10
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SyntaxSparrow",
8+
platforms: [
9+
.macOS(.v10_15),
10+
.iOS(.v13),
11+
.tvOS(.v13),
12+
.watchOS(.v6),
13+
.macCatalyst(.v13)
14+
],
15+
products: [
16+
// Products define the executables and libraries a package produces, and make them visible to other packages.
17+
.library(
18+
name: "SyntaxSparrow",
19+
targets: ["SyntaxSparrow"]
20+
),
21+
],
22+
dependencies: [
23+
.package(url: "https://github.com/swiftlang/swift-syntax.git", from: "600.0.1"),
24+
],
25+
targets: [
26+
.target(
27+
name: "SyntaxSparrow",
28+
dependencies: [
29+
.product(name: "SwiftSyntax", package: "swift-syntax"),
30+
.product(name: "SwiftParser", package: "swift-syntax"),
31+
],
32+
resources: [
33+
.copy("Resources/PrivacyInfo.xcprivacy")
34+
]
35+
),
36+
.testTarget(
37+
name: "SyntaxSparrowTests",
38+
dependencies: [
39+
"SyntaxSparrow",
40+
]
41+
),
42+
]
43+
)
44+
45+
// Supplementary
46+
package.dependencies.append(contentsOf: [
47+
.package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "0.12.0"),
48+
])

0 commit comments

Comments
 (0)