Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test GitHub Action Runners with Xcode 15.4 #18

Merged
merged 14 commits into from
Jun 28, 2024
15 changes: 7 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
name: Build and Test

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

jobs:
reuse_action:
name: REUSE Compliance Check
uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2
swiftlint:
name: SwiftLint
uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2
packageios:
name: Build and Test Swift Package iOS
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
Expand Down Expand Up @@ -59,7 +61,6 @@ jobs:
name: Build and Test iOS
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
with:
runsonlabels: '["macOS", "self-hosted"]'
path: 'Tests/UITests'
scheme: TestApp
resultBundle: TestApp-iOS.xcresult
Expand All @@ -68,7 +69,6 @@ jobs:
name: Build and Test iPadOS
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
with:
runsonlabels: '["macOS", "self-hosted"]'
path: 'Tests/UITests'
scheme: TestApp
destination: 'platform=iOS Simulator,name=iPad Air (5th generation)'
Expand Down Expand Up @@ -98,7 +98,6 @@ jobs:
name: Build and Test tvOS
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
with:
runsonlabels: '["macOS", "self-hosted"]'
path: 'Tests/UITests'
scheme: TestApp
destination: 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# This source file is part of the TemplatePackage open source project
#
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Main

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: main
cancel-in-progress: false

jobs:
buildandtest:
name: Build and Test
uses: ./.github/workflows/build-and-test.yml
secrets: inherit
14 changes: 8 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ on:
pull_request:
workflow_dispatch:

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
reuse_action:
name: REUSE Compliance Check
uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2
swiftlint:
name: SwiftLint
uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2
buildandtest:
name: Build and Test
uses: ./.github/workflows/build-and-test.yml
secrets: inherit
20 changes: 20 additions & 0 deletions Tests/UITests/TestApp/OperatingSystem.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// This source file is part of the TemplatePackage open-source project
//
// SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//


#if os(macOS)
let operatingSystem = "macOS"
#elseif os(iOS)
let operatingSystem = "iOS"
#elseif os(watchOS)
let operatingSystem = "watchOS"
#elseif os(visionOS)
let operatingSystem = "visionOS"
#elseif os(tvOS)
let operatingSystem = "tvOS"
#endif
1 change: 1 addition & 0 deletions Tests/UITests/TestApp/TestApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct UITestsApp: App {
var body: some Scene {
WindowGroup {
Text(TemplatePackage().stanford)
Text(operatingSystem)
}
}
}
3 changes: 3 additions & 0 deletions Tests/UITests/TestAppUITests/TestAppUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// SPDX-License-Identifier: MIT
//

import OSLog
import XCTest


Expand All @@ -20,6 +21,8 @@ class TestAppUITests: XCTestCase {
func testTemplatePackage() throws {
let app = XCUIApplication()
app.launch()

XCTAssert(app.staticTexts["Stanford University"].waitForExistence(timeout: 0.1))
XCTAssert(app.staticTexts[operatingSystem].exists)
}
}
10 changes: 10 additions & 0 deletions Tests/UITests/UITests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
2F9CBEDA2A76C795009818FF /* TemplatePackage in Frameworks */ = {isa = PBXBuildFile; productRef = 2F9CBED92A76C795009818FF /* TemplatePackage */; };
2F9CBEDB2A76C7EC009818FF /* TestAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F8A431229130A8C005D2B8F /* TestAppUITests.swift */; };
2FA7382C290ADFAA007ACEB9 /* TestApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FA7382B290ADFAA007ACEB9 /* TestApp.swift */; };
2FB5B6E02C2F6C50009162E6 /* OperatingSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */; };
2FB5B6E12C2F6DBC009162E6 /* OperatingSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */; };
2FB5B6E22C2F707A009162E6 /* OperatingSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */; };
2FB5B6E32C2F707B009162E6 /* OperatingSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */; };
/* End PBXBuildFile section */

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

Expand Down Expand Up @@ -138,6 +143,7 @@
isa = PBXGroup;
children = (
2FA7382B290ADFAA007ACEB9 /* TestApp.swift */,
2FB5B6DF2C2F6C50009162E6 /* OperatingSystem.swift */,
2F6D139928F5F386007C25D6 /* Assets.xcassets */,
);
path = TestApp;
Expand Down Expand Up @@ -326,13 +332,15 @@
buildActionMask = 2147483647;
files = (
2FA7382C290ADFAA007ACEB9 /* TestApp.swift in Sources */,
2FB5B6E02C2F6C50009162E6 /* OperatingSystem.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2F6D13A828F5F386007C25D6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2FB5B6E22C2F707A009162E6 /* OperatingSystem.swift in Sources */,
2F8A431329130A8C005D2B8F /* TestAppUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -341,6 +349,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2FB5B6E12C2F6DBC009162E6 /* OperatingSystem.swift in Sources */,
2F9CBED72A76C752009818FF /* TestApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -349,6 +358,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2FB5B6E32C2F707B009162E6 /* OperatingSystem.swift in Sources */,
2F9CBEDB2A76C7EC009818FF /* TestAppUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Loading