Skip to content

Commit 87b6f0b

Browse files
shahmishaljakepetroules
authored andcommitted
[CI] Add support for GitHub Actions
# Conflicts: # .github/workflows/pull_request.yml
1 parent 84b3e6e commit 87b6f0b

File tree

5 files changed

+20
-25
lines changed

5 files changed

+20
-25
lines changed

.github/scripts/prebuild.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,6 @@ elif command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy
4646
if [[ "$INSTALL_CMAKE" == "1" ]] ; then
4747
apt-get install -y cmake ninja-build
4848
fi
49-
50-
# Android NDK
51-
dpkg_architecture="$(dpkg --print-architecture)"
52-
if [[ "$SKIP_ANDROID" != "1" ]] && [[ "$dpkg_architecture" == amd64 ]] ; then
53-
eval "$(cat /etc/os-release)"
54-
case "$VERSION_CODENAME" in
55-
bookworm|jammy)
56-
: # Not available
57-
;;
58-
noble)
59-
apt-get install -y google-android-ndk-r26c-installer
60-
;;
61-
*)
62-
echo "Unable to fetch Android NDK for unknown Linux distribution: $VERSION_CODENAME" >&2
63-
exit 1
64-
esac
65-
else
66-
echo "Skipping Android NDK installation on $dpkg_architecture" >&2
67-
fi
6849
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
6950
dnf update -y
7051

.github/workflows/pull_request.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ jobs:
1919
linux_os_versions: '["amazonlinux2", "bookworm", "noble", "jammy", "rhel-ubi9"]'
2020
linux_swift_versions: '["nightly-main"]'
2121
linux_pre_build_command: ./.github/scripts/prebuild.sh
22-
linux_build_command: 'swift build'
22+
linux_build_command: 'swift build --build-tests'
2323
windows_swift_versions: '["nightly-main"]'
2424
windows_pre_build_command: 'Invoke-Program .\.github\scripts\prebuild.ps1'
25-
windows_build_command: 'Invoke-Program swift build'
25+
windows_build_command: 'Invoke-Program swift build --build-tests'
2626
enable_ios_checks: true
2727
enable_macos_checks: true
2828
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.3\"}, {\"xcode_version\": \"16.4\"}]"
29-
macos_build_command: 'swift build'
29+
macos_build_command: 'swift build --build-tests'
30+
enable_android_sdk_build: true
31+
android_sdk_build_command: "swift build --build-tests"
32+
android_ndk_versions: '["r27d", "r29"]'
33+
android_sdk_triples: '["aarch64-unknown-linux-android28"]'
3034

3135
soundness:
3236
name: Soundness

Sources/Basics/Concurrency/AsyncProcess.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
2525

2626
@_implementationOnly
2727
import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np
28+
29+
@_implementationOnly
30+
import func TSCclibc.SPM_posix_spawnp
2831
#else
29-
private import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
30-
private import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np
32+
package import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
33+
package import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np
34+
package import func TSCclibc.SPM_posix_spawnp
3135
#endif // #if USE_IMPL_ONLY_IMPORTS
3236
#endif
3337

@@ -687,7 +691,11 @@ package final class AsyncProcess {
687691
}
688692
let argv = CStringArray(resolvedArgs)
689693
let env = CStringArray(environment.map { "\($0.0)=\($0.1)" })
694+
#if canImport(Darwin)
690695
let rv = posix_spawnp(&self.processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray)
696+
#else
697+
let rv = SPM_posix_spawnp(&self.processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray)
698+
#endif
691699

692700
guard rv == 0 else {
693701
throw SystemError.posix_spawn(rv, self.arguments)

Tests/FunctionalTests/LibraryEvolutionXCFLinuxTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private struct SwiftPMTests {
3535
let arch = "aarch64"
3636
#elseif arch(x86_64)
3737
let arch = "x86_64"
38+
#else
39+
preconditionFailure("Unsupported platform or host arch for test")
3840
#endif
3941

4042
let platform = "linux"

Tests/IntegrationTests/SwiftPMTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private struct SwiftPMTests {
216216
#elseif arch(arm64)
217217
hostArch = "arm64"
218218
#else
219-
precondition("Unsupported platform or host arch for test")
219+
preconditionFailure("Unsupported platform or host arch for test")
220220
#endif
221221
switch buildSystem {
222222
case .native:

0 commit comments

Comments
 (0)