Skip to content

Commit d954016

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

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct CMakeSmokeTest: CommandPlugin {
3333
if let sysrootPath {
3434
print("using sysroot at \(sysrootPath)")
3535
}
36+
let extraCMakeArgs = args.extractOption(named: "extra-cmake-arg")
3637

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

@@ -80,7 +81,7 @@ struct CMakeSmokeTest: CommandPlugin {
8081
"-DCMAKE_MAKE_PROGRAM=\(ninjaPath)",
8182
"-DCMAKE_BUILD_TYPE:=Debug",
8283
"-DCMAKE_Swift_FLAGS='\(sharedSwiftFlags.joined(separator: " "))'"
83-
] + cMakeProjectArgs
84+
] + cMakeProjectArgs + extraCMakeArgs
8485

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

0 commit comments

Comments
 (0)