Skip to content

Commit fde62a1

Browse files
committed
Run the CMake smoke test on macOS as well
1 parent 5552e48 commit fde62a1

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed
File renamed without changes.

.github/scripts/linux_pre_build.sh renamed to .github/scripts/prebuild.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313

1414
set -e
1515

16-
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy
16+
if [[ $(uname) == Darwin ]] ; then
17+
if [[ "$INSTALL_CMAKE" == "1" ]] ; then
18+
brew install cmake ninja
19+
fi
20+
elif command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy
1721
export DEBIAN_FRONTEND=noninteractive
1822

1923
apt-get update -y

.github/workflows/pull_request.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ jobs:
1414
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
1515
with:
1616
linux_os_versions: '["amazonlinux2", "bookworm", "noble", "jammy", "rhel-ubi9"]'
17-
linux_pre_build_command: ./.github/scripts/linux_pre_build.sh
17+
linux_pre_build_command: ./.github/scripts/prebuild.sh
1818
linux_build_command: 'swift test --no-parallel'
1919
linux_swift_versions: '["nightly-main", "nightly-6.2"]'
20-
windows_pre_build_command: 'Invoke-Program .\.github\scripts\windows_pre_build.ps1'
20+
windows_pre_build_command: 'Invoke-Program .\.github\scripts\prebuild.ps1'
2121
windows_swift_versions: '["nightly-main"]'
2222
windows_build_command: 'Invoke-Program swift test --no-parallel'
2323
enable_linux_static_sdk_build: true
2424
linux_static_sdk_build_command: SWIFTBUILD_STATIC_LINK=1 LLBUILD_STATIC_LINK=1 swift build
2525
enable_macos_checks: true
2626
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.3\"}, {\"xcode_version\": \"16.4\"}]"
27+
macos_pre_build_command: ./.github/scripts/prebuild.sh
2728
macos_build_command:
2829
swift test &&
2930
/usr/bin/xcrun xcodebuild -workspace . -scheme SwiftBuild-Package -destination generic/platform=iOS
@@ -32,10 +33,14 @@ jobs:
3233
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
3334
with:
3435
linux_os_versions: '["noble"]'
35-
linux_pre_build_command: SKIP_ANDROID=1 INSTALL_CMAKE=1 ./.github/scripts/linux_pre_build.sh
36+
linux_pre_build_command: SKIP_ANDROID=1 INSTALL_CMAKE=1 ./.github/scripts/prebuild.sh
3637
linux_build_command: 'swift package -Xbuild-tools-swiftc -DUSE_PROCESS_SPAWNING_WORKAROUND cmake-smoke-test --disable-sandbox --cmake-path `which cmake` --ninja-path `which ninja` --extra-cmake-arg -DCMAKE_C_COMPILER=`which clang` --extra-cmake-arg -DCMAKE_CXX_COMPILER=`which clang++` --extra-cmake-arg -DCMAKE_Swift_COMPILER=`which swiftc`'
3738
linux_swift_versions: '["nightly-main"]'
38-
windows_pre_build_command: 'Invoke-Program .\.github\scripts\windows_pre_build.ps1 -SkipAndroid -InstallCMake'
39+
enable_macos_checks: true
40+
macos_xcode_versions: '["26.0"]'
41+
macos_pre_build_command: SKIP_ANDROID=1 INSTALL_CMAKE=1 ./.github/scripts/prebuild.sh
42+
macos_build_command: 'swift package cmake-smoke-test --disable-sandbox --cmake-path `which cmake` --ninja-path `which ninja` --extra-cmake-arg -DCMAKE_C_COMPILER=`which clang` --extra-cmake-arg -DCMAKE_CXX_COMPILER=`which clang++` --extra-cmake-arg -DCMAKE_Swift_COMPILER=`which swiftc`'
43+
windows_pre_build_command: 'Invoke-Program .\.github\scripts\prebuild.ps1 -SkipAndroid -InstallCMake'
3944
windows_swift_versions: '["nightly-main"]'
4045
windows_build_command: 'Invoke-Program swift package cmake-smoke-test --disable-sandbox --cmake-path (Get-Command cmake).Path --ninja-path (Get-Command ninja).Path --extra-cmake-arg "-DCMAKE_C_COMPILER=$((Get-Command clang).Path)" --extra-cmake-arg "-DCMAKE_CXX_COMPILER=$((Get-Command clang).Path)" --extra-cmake-arg "-DCMAKE_Swift_COMPILER=$((Get-Command swiftc).Path)" --extra-cmake-arg "-DCMAKE_STATIC_LIBRARY_PREFIX_Swift=lib" --extra-cmake-arg "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL"'
4146

0 commit comments

Comments
 (0)