Skip to content

Commit f3578ca

Browse files
committed
Setup a basic run of cmake-smoke-test in CI
1 parent a3caaf5 commit f3578ca

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.github/workflows/pull_request.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ jobs:
4545
linux_swift_versions: '["nightly-main", "nightly-6.2"]'
4646
windows_swift_versions: '["nightly-main"]'
4747
windows_build_command: 'swift test --no-parallel'
48+
cmake-smoke-test:
49+
name: cmake-smoke-test
50+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
51+
with:
52+
linux_os_versions: '["noble"]'
53+
linux_pre_build_command: |
54+
apt-get update -y
55+
56+
# Build dependencies
57+
apt-get install -y libsqlite3-dev libncurses-dev
58+
59+
apt-get install -y cmake ninja-build
60+
linux_build_command: 'swift package cmake-smoke-test --disable-sandbox --cmake-path `which cmake` --ninja-path `which ninja`'
61+
linux_swift_versions: '["nightly-main"]'
62+
windows_swift_versions: '[]'
4863
soundness:
4964
name: Soundness
5065
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main

Plugins/cmake-smoke-test/cmake-smoke-test.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Foundation
1616
@main
1717
struct CMakeSmokeTest: CommandPlugin {
1818
func performCommand(context: PluginContext, arguments: [String]) async throws {
19+
print(arguments)
1920
var args = ArgumentExtractor(arguments)
2021
let hostOS = try OS.host()
2122

@@ -33,6 +34,7 @@ struct CMakeSmokeTest: CommandPlugin {
3334
if let sysrootPath {
3435
print("using sysroot at \(sysrootPath)")
3536
}
37+
let extraCMakeArgs = args.extractOption(named: "extra-cmake-arg")
3638

3739
let moduleCachePath = context.pluginWorkDirectoryURL.appending(component: "module-cache").path()
3840

@@ -43,6 +45,9 @@ struct CMakeSmokeTest: CommandPlugin {
4345
let swiftToolsSupportCoreURL = try findDependency("swift-tools-support-core", pluginContext: context)
4446
let swiftToolsSupportCoreBuildURL = context.pluginWorkDirectoryURL.appending(component: "swift-tools-support-core")
4547

48+
exit(1)
49+
50+
4651
let swiftSystemURL = try findDependency("swift-system", pluginContext: context)
4752
let swiftSystemBuildURL = context.pluginWorkDirectoryURL.appending(component: "swift-system")
4853

@@ -80,7 +85,7 @@ struct CMakeSmokeTest: CommandPlugin {
8085
"-DCMAKE_MAKE_PROGRAM=\(ninjaPath)",
8186
"-DCMAKE_BUILD_TYPE:=Debug",
8287
"-DCMAKE_Swift_FLAGS='\(sharedSwiftFlags.joined(separator: " "))'"
83-
] + cMakeProjectArgs
88+
] + cMakeProjectArgs + extraCMakeArgs
8489

8590
print("Building swift-tools-support-core")
8691
try await Process.checkNonZeroExit(url: cmakeURL, arguments: sharedCMakeArgs + [swiftToolsSupportCoreURL.path()], workingDirectory: swiftToolsSupportCoreBuildURL)

0 commit comments

Comments
 (0)