Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ on:
default: ""
macos_runner_pool:
type: string
description: "The self-hosted runner pool for macOS benchmark jobs."
default: "general"
description: "Label of the pool of self-hosted macOS runners to use, for an organization that splits its runners into pools such as general and nightly. Empty adds no pool label."
default: ""
linux_env_vars:
type: string
description: "Environment variables for Linux jobs as JSON."
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ on:
default: "ARM64"
macos_runner_pool:
type: string
description: "macOS self-hosted runner pool label."
default: "general"
description: "Label of the pool of self-hosted macOS runners to use, for an organization that splits its runners into pools such as general and nightly. Empty adds no pool label."
default: ""
xcode_debug_output:
type: boolean
description: "Drop -quiet from the xcodebuild target invocations."
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/scripts/matrix/generate-matrix.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct Configuration {
@Input("MACOS_SWIFT_VERSIONS") var macOSVersions: [String] = []
@Input("MACOS_OS") var macOSOS: OSList = "tahoe"
@Input("MACOS_ARCH") var macOSArchitecture = "ARM64"
@Input("MACOS_RUNNER_POOL") var macOSPool = "general"
@Input("MACOS_RUNNER_POOL") var macOSPool = ""
@Input("MACOS_COMMAND") var macOSCommands: Commands = "xcrun swift test"
@Input("MACOS_SETUP_COMMAND") var macOSSetupCommand = ""
@Input("MACOS_ENV_VARS") var macOSEnvironment = JSONValue.object([:])
Expand Down Expand Up @@ -900,9 +900,12 @@ struct Runner {
Runner(labels: [label], name: label)
}

/// A machine from one of the self-hosted macOS pools.
/// A machine from the self-hosted macOS runners, in one of their pools if the organization
/// splits them into pools. A pool label no runner carries leaves the job waiting forever,
/// so an empty pool adds none.
static func macOS(os: String, architecture: String, pool: String) -> Runner {
Runner(labels: ["self-hosted", "macos", os, architecture, pool], name: os)
let poolLabels = pool.isEmpty ? [] : [pool]
return Runner(labels: ["self-hosted", "macos", os, architecture] + poolLabels, name: os)
}
}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/toolchain_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ on:
default: "ARM64"
macos_runner_pool:
type: string
description: "macOS self-hosted runner pool label."
default: "general"
description: "Label of the pool of self-hosted macOS runners to use, for an organization that splits its runners into pools such as general and nightly. Empty adds no pool label."
default: ""
windows_swift_versions:
type: string
description: "Windows Swift version list (JSON/YAML array). Empty uses current-2, current-1, current, nightly-release and nightly-main."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct OSInputTests {
let macOS = try Generator.run([
"ENABLE_MACOS": "true", "MACOS_SWIFT_VERSIONS": #"["6.3"]"#, "MACOS_OS": "sequoia",
])
#expect(macOS.entries.first?.runner == ["self-hosted", "macos", "sequoia", "ARM64", "general"])
#expect(macOS.entries.first?.runner == ["self-hosted", "macos", "sequoia", "ARM64"])

let windows = try Generator.run([
"ENABLE_WINDOWS": "true", "WINDOWS_SWIFT_VERSIONS": #"["6.3"]"#, "WINDOWS_OS": "windows-11-arm",
Expand All @@ -150,7 +150,7 @@ struct OSInputTests {
let macOS = try Generator.run([
"ENABLE_MACOS": "true", "MACOS_SWIFT_VERSIONS": #"["6.3"]"#, "MACOS_OS": "26.10",
])
#expect(macOS.entries.first?.runner == ["self-hosted", "macos", "26.10", "ARM64", "general"])
#expect(macOS.entries.first?.runner == ["self-hosted", "macos", "26.10", "ARM64"])
}

@Test("One OS leaves the job names alone, however it is written")
Expand Down Expand Up @@ -252,6 +252,18 @@ struct OSInputTests {
#expect(generated.standardError.contains(#"["jammy""#))
#expect(!generated.standardError.contains("bad file"))
}

@Test("A pool label is added to the runner labels only when one is given")
func macOSPoolLabelIsOptional() throws {
let environment = ["ENABLE_MACOS": "true", "MACOS_SWIFT_VERSIONS": #"["6.3"]"#, "MACOS_OS": "tahoe"]
let without = try Generator.run(environment)
#expect(without.entries.first?.runner == ["self-hosted", "macos", "tahoe", "ARM64"])

var pooled = environment
pooled["MACOS_RUNNER_POOL"] = "nightly"
let with = try Generator.run(pooled)
#expect(with.entries.first?.runner == ["self-hosted", "macos", "tahoe", "ARM64", "nightly"])
}
}

@Suite("Minimum version detection")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct MacOSTests {
let entry = try #require(generated.entries.first)
#expect(entry.xcodeBuild?.xcodeVersion == "swift_6.3")
#expect(entry.xcodeBuild?.swiftlyToolchain == "main-snapshot")
#expect(entry.runner == ["self-hosted", "macos", "sequoia", "X64", "general"])
#expect(entry.runner == ["self-hosted", "macos", "sequoia", "X64"])
#expect(entry.command == "swiftly run swift build")
}

Expand Down
Loading