Skip to content

Commit 39e6d96

Browse files
authored
Update CI (#63)
1 parent 66a71ec commit 39e6d96

File tree

9 files changed

+300
-230
lines changed

9 files changed

+300
-230
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,45 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
library:
18-
runs-on: macos-12
17+
library-swift-latest:
18+
name: Library (swift-latest)
19+
runs-on: macos-13
1920
strategy:
2021
matrix:
21-
xcode: ['14.2']
2222
config: ['debug', 'release']
2323
steps:
2424
- uses: actions/checkout@v3
25-
- name: Select Xcode ${{ matrix.xcode }}
26-
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
27-
- name: Run tests
28-
run: make test-swift
25+
- name: Select Xcode 14.3
26+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
27+
- name: Run ${{ matrix.config }} tests
28+
run: CONFIG=${{ matrix.config }} make test-library
2929
- name: Build platforms ${{ matrix.config }}
3030
run: CONFIG=${{ matrix.config }} make build-all-platforms
31+
32+
library-evolution:
33+
name: Library (evolution)
34+
runs-on: macos-13
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: Select Xcode 14.3
38+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
3139
- name: Build for library evolution
3240
run: make build-for-library-evolution
41+
42+
library-swift-5-7:
43+
name: Library (swift 5.7)
44+
runs-on: macos-12
45+
strategy:
46+
matrix:
47+
config: ['debug', 'release']
48+
steps:
49+
- uses: actions/checkout@v3
50+
- name: Select Xcode 14.2
51+
run: sudo xcode-select -s /Applications/Xcode_14.2.app
52+
- name: Run ${{ matrix.config }} tests
53+
run: CONFIG=${{ matrix.config }} make test-library
54+
- name: Build platforms ${{ matrix.config }}
55+
run: CONFIG=${{ matrix.config }} make build-all-platforms
3356

3457
ubuntu-tests:
3558
strategy:
@@ -40,3 +63,17 @@ jobs:
4063
- uses: actions/checkout@v3
4164
- name: Run tests
4265
run: make test-swift
66+
67+
static-stdlib:
68+
strategy:
69+
matrix:
70+
image: ['swift:5.7-focal', 'swift:5.8-focal']
71+
runs-on: ubuntu-latest
72+
container:
73+
image: ${{ matrix.image }}
74+
steps:
75+
- uses: actions/checkout@v3
76+
- name: Build for static-stdlib (debug)
77+
run: swift build -c debug --static-swift-stdlib
78+
- name: Build for static-stdlib (release)
79+
run: swift build -c release --static-swift-stdlib

.github/workflows/format.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ concurrency:
1212
jobs:
1313
swift_format:
1414
name: swift-format
15-
runs-on: macos-12
15+
runs-on: macos-13
1616
steps:
17-
- uses: actions/checkout@v3
18-
- name: Xcode Select
19-
run: sudo xcode-select -s /Applications/Xcode_14.0.1.app
20-
- name: Tap
21-
run: brew tap pointfreeco/formulae
22-
- name: Install
23-
run: brew install Formulae/swift-format@5.7
17+
- uses: actions/checkout@v2
18+
- name: Select Xcode 14.3
19+
run: sudo xcode-select -s /Applications/Xcode_14.3.app
20+
- name: Install swift-format
21+
run: brew install swift-format
2422
- name: Format
2523
run: make format
2624
- uses: stefanzweifel/git-auto-commit-action@v4

DependenciesAdditions.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CONFIG = debug
12
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro Max
23
PLATFORM_MACOS = macOS
34
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
@@ -6,7 +7,21 @@ PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 7 (45mm)
67

78
CONFIG = debug
89

9-
default: test
10+
default: test-all
11+
12+
test-all:
13+
CONFIG=debug test-library
14+
CONFIG=release test-library
15+
16+
test-library:
17+
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
18+
xcodebuild test \
19+
-configuration $(CONFIG) \
20+
-workspace DependenciesAdditions.xcworkspace \
21+
-scheme DependenciesAdditions \
22+
-destination platform="$$platform" || exit 1; \
23+
done;
24+
1025

1126
build-all-platforms:
1227
for platform in \
@@ -35,18 +50,34 @@ test-linux:
3550
swift:5.7-focal \
3651
bash -c 'apt-get update && apt-get -y install make && make test-swift'
3752

53+
build-for-static-stdlib:
54+
@swift build -c debug --static-swift-stdlib
55+
@swift build -c release --static-swift-stdlib
56+
3857
build-for-library-evolution:
3958
swift build \
4059
-c release \
41-
--target Dependencies \
42-
-Xswiftc -emit-module-interface \
60+
--target DependenciesAdditions \
4361
-Xswiftc -enable-library-evolution
4462

63+
build-for-static-stdlib-docker:
64+
@docker run \
65+
-v "$(PWD):$(PWD)" \
66+
-w "$(PWD)" \
67+
swift:5.8-focal \
68+
bash -c "swift build -c debug --static-swift-stdlib"
69+
@docker run \
70+
-v "$(PWD):$(PWD)" \
71+
-w "$(PWD)" \
72+
swift:5.8-focal \
73+
bash -c "swift build -c release --static-swift-stdlib"
74+
4575
format:
4676
swift format \
4777
--ignore-unparsable-files \
4878
--in-place \
4979
--recursive \
5080
./Package.swift ./Sources ./Tests
5181

52-
.PHONY: test test-swift test-linux build-for-library-evolution format
82+
83+
.PHONY: test test-swift test-linux build-for-library-evolution format

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ let package = Package(
4444
.library(name: "_SwiftUIDependency", targets: ["_SwiftUIDependency"]),
4545
],
4646
dependencies: [
47-
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "0.1.0"),
47+
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "0.4.0"),
4848
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
4949
],
5050
targets: [

Tests/AccessibilityDependencyTests/AccessibilityDependencyTests.swift

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -190,33 +190,35 @@
190190
}
191191
#endif
192192

193-
@MainActor
194-
func testConvertToScreenCoordinatesUsingCGRect() {
195-
XCTExpectFailure {
196-
let _ = accessibility.convertToScreenCoordinates(CGRect.zero, in: .init())
193+
#if DEBUG
194+
@MainActor
195+
func testConvertToScreenCoordinatesUsingCGRect() {
196+
XCTExpectFailure {
197+
let _ = accessibility.convertToScreenCoordinates(CGRect.zero, in: .init())
198+
}
197199
}
198-
}
199200

200-
@MainActor
201-
func testConvertToScreenCoordinatesUsingUIBezierPath() {
202-
XCTExpectFailure {
203-
let _ = accessibility.convertToScreenCoordinates(UIBezierPath.init(), in: .init())
201+
@MainActor
202+
func testConvertToScreenCoordinatesUsingUIBezierPath() {
203+
XCTExpectFailure {
204+
let _ = accessibility.convertToScreenCoordinates(UIBezierPath.init(), in: .init())
205+
}
204206
}
205-
}
206207

207-
func testFocusedElement() {
208-
XCTExpectFailure {
209-
let _ = accessibility.focusedElement(using: nil)
208+
func testFocusedElement() {
209+
XCTExpectFailure {
210+
let _ = accessibility.focusedElement(using: nil)
211+
}
210212
}
211-
}
212213

213-
func testPost() {
214-
XCTExpectFailure {
215-
let _ = accessibility.post(
216-
notification: UIAccessibility.Notification(rawValue: 0),
217-
argument: nil
218-
)
214+
func testPost() {
215+
XCTExpectFailure {
216+
let _ = accessibility.post(
217+
notification: UIAccessibility.Notification(rawValue: 0),
218+
argument: nil
219+
)
220+
}
219221
}
220-
}
222+
#endif
221223
}
222224
#endif

0 commit comments

Comments
 (0)