Skip to content

Commit f24d296

Browse files
Test GitHub Action Runners with Xcode 15.4 (#18)
# Test GitHub Action Runners with Xcode 15.4 ## ♻️ Current situation & Problem - We currently rely on our own runners as shown in #17 and had build errors as also documented in actions/runner-images#9511 (comment) ## ⚙️ Release Notes - Switch to GitHub-hosted runners and explore the situation after some Xcode updates. ### Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
1 parent 05954d7 commit f24d296

File tree

7 files changed

+74
-14
lines changed

7 files changed

+74
-14
lines changed

.github/workflows/build-and-test.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
name: Build and Test
1010

1111
on:
12-
push:
13-
branches:
14-
- main
15-
pull_request:
16-
workflow_dispatch:
12+
workflow_call:
1713

1814
jobs:
15+
reuse_action:
16+
name: REUSE Compliance Check
17+
uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2
18+
swiftlint:
19+
name: SwiftLint
20+
uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2
1921
packageios:
2022
name: Build and Test Swift Package iOS
2123
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
@@ -59,7 +61,6 @@ jobs:
5961
name: Build and Test iOS
6062
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
6163
with:
62-
runsonlabels: '["macOS", "self-hosted"]'
6364
path: 'Tests/UITests'
6465
scheme: TestApp
6566
resultBundle: TestApp-iOS.xcresult
@@ -68,7 +69,6 @@ jobs:
6869
name: Build and Test iPadOS
6970
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
7071
with:
71-
runsonlabels: '["macOS", "self-hosted"]'
7272
path: 'Tests/UITests'
7373
scheme: TestApp
7474
destination: 'platform=iOS Simulator,name=iPad Air (5th generation)'
@@ -98,7 +98,6 @@ jobs:
9898
name: Build and Test tvOS
9999
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
100100
with:
101-
runsonlabels: '["macOS", "self-hosted"]'
102101
path: 'Tests/UITests'
103102
scheme: TestApp
104103
destination: 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'

.github/workflows/main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# This source file is part of the TemplatePackage open source project
3+
#
4+
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
5+
#
6+
# SPDX-License-Identifier: MIT
7+
#
8+
9+
name: Main
10+
11+
on:
12+
push:
13+
branches:
14+
- main
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: main
19+
cancel-in-progress: false
20+
21+
jobs:
22+
buildandtest:
23+
name: Build and Test
24+
uses: ./.github/workflows/build-and-test.yml
25+
secrets: inherit

.github/workflows/pull_request.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ on:
1212
pull_request:
1313
workflow_dispatch:
1414

15+
concurrency:
16+
group: build-${{ github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
16-
reuse_action:
17-
name: REUSE Compliance Check
18-
uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2
19-
swiftlint:
20-
name: SwiftLint
21-
uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2
20+
buildandtest:
21+
name: Build and Test
22+
uses: ./.github/workflows/build-and-test.yml
23+
secrets: inherit
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// This source file is part of the TemplatePackage open-source project
3+
//
4+
// SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
5+
//
6+
// SPDX-License-Identifier: MIT
7+
//
8+
9+
10+
#if os(macOS)
11+
let operatingSystem = "macOS"
12+
#elseif os(iOS)
13+
let operatingSystem = "iOS"
14+
#elseif os(watchOS)
15+
let operatingSystem = "watchOS"
16+
#elseif os(visionOS)
17+
let operatingSystem = "visionOS"
18+
#elseif os(tvOS)
19+
let operatingSystem = "tvOS"
20+
#endif

Tests/UITests/TestApp/TestApp.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct UITestsApp: App {
1515
var body: some Scene {
1616
WindowGroup {
1717
Text(TemplatePackage().stanford)
18+
Text(operatingSystem)
1819
}
1920
}
2021
}

Tests/UITests/TestAppUITests/TestAppUITests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// SPDX-License-Identifier: MIT
77
//
88

9+
import OSLog
910
import XCTest
1011

1112

@@ -20,6 +21,8 @@ class TestAppUITests: XCTestCase {
2021
func testTemplatePackage() throws {
2122
let app = XCUIApplication()
2223
app.launch()
24+
2325
XCTAssert(app.staticTexts["Stanford University"].waitForExistence(timeout: 0.1))
26+
XCTAssert(app.staticTexts[operatingSystem].exists)
2427
}
2528
}

Tests/UITests/UITests.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
2F9CBEDA2A76C795009818FF /* TemplatePackage in Frameworks */ = {isa = PBXBuildFile; productRef = 2F9CBED92A76C795009818FF /* TemplatePackage */; };
1717
2F9CBEDB2A76C7EC009818FF /* TestAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F8A431229130A8C005D2B8F /* TestAppUITests.swift */; };
1818
2FA7382C290ADFAA007ACEB9 /* TestApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FA7382B290ADFAA007ACEB9 /* TestApp.swift */; };
19+
2FB5B6E02C2F6C50009162E6 /* OperatingSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */; };
20+
2FB5B6E12C2F6DBC009162E6 /* OperatingSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */; };
21+
2FB5B6E22C2F707A009162E6 /* OperatingSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */; };
22+
2FB5B6E32C2F707B009162E6 /* OperatingSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */; };
1923
/* End PBXBuildFile section */
2024

2125
/* Begin PBXContainerItemProxy section */
@@ -73,6 +77,7 @@
7377
2F9CBEBF2A76C412009818FF /* TestAppWatchAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestAppWatchAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7478
2FA7382B290ADFAA007ACEB9 /* TestApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestApp.swift; sourceTree = "<group>"; };
7579
2FB0758A299DDB9000C0B37F /* TestApp.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = TestApp.xctestplan; sourceTree = "<group>"; };
80+
2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OperatingSystem.swift; sourceTree = "<group>"; };
7681
2FF8922E2A770D4200903A5A /* TestAppWatchApp.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = TestAppWatchApp.xctestplan; sourceTree = "<group>"; };
7782
/* End PBXFileReference section */
7883

@@ -138,6 +143,7 @@
138143
isa = PBXGroup;
139144
children = (
140145
2FA7382B290ADFAA007ACEB9 /* TestApp.swift */,
146+
2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */,
141147
2F6D139928F5F386007C25D6 /* Assets.xcassets */,
142148
);
143149
path = TestApp;
@@ -326,13 +332,15 @@
326332
buildActionMask = 2147483647;
327333
files = (
328334
2FA7382C290ADFAA007ACEB9 /* TestApp.swift in Sources */,
335+
2FB5B6E02C2F6C50009162E6 /* OperatingSystem.swift in Sources */,
329336
);
330337
runOnlyForDeploymentPostprocessing = 0;
331338
};
332339
2F6D13A828F5F386007C25D6 /* Sources */ = {
333340
isa = PBXSourcesBuildPhase;
334341
buildActionMask = 2147483647;
335342
files = (
343+
2FB5B6E22C2F707A009162E6 /* OperatingSystem.swift in Sources */,
336344
2F8A431329130A8C005D2B8F /* TestAppUITests.swift in Sources */,
337345
);
338346
runOnlyForDeploymentPostprocessing = 0;
@@ -341,6 +349,7 @@
341349
isa = PBXSourcesBuildPhase;
342350
buildActionMask = 2147483647;
343351
files = (
352+
2FB5B6E12C2F6DBC009162E6 /* OperatingSystem.swift in Sources */,
344353
2F9CBED72A76C752009818FF /* TestApp.swift in Sources */,
345354
);
346355
runOnlyForDeploymentPostprocessing = 0;
@@ -349,6 +358,7 @@
349358
isa = PBXSourcesBuildPhase;
350359
buildActionMask = 2147483647;
351360
files = (
361+
2FB5B6E32C2F707B009162E6 /* OperatingSystem.swift in Sources */,
352362
2F9CBEDB2A76C7EC009818FF /* TestAppUITests.swift in Sources */,
353363
);
354364
runOnlyForDeploymentPostprocessing = 0;

0 commit comments

Comments
 (0)