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
69 changes: 68 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,40 @@ on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

env:
OPENBSD_META_DATA_CONTENT: |
{
"instance-id": "iid-local01",
"dsmode": "local"
}
OPENBSD_USER_DATA_CONTENT: |
#cloud-config
timezone: UTC
write_files:
- content: |
set -ex
function atexit {
echo 1 > /tmp/result
tar cvf /dev/sd1c -C /tmp result
halt -p;
}
trap atexit EXIT
printf '\033\143'
export PATH=/usr/local/bin:$PATH
mount /dev/sd3c /mnt
cp -r /mnt/repo /home/repo/
cd /home/repo/
swift build
echo $? > /tmp/result
tar cvf /dev/sd1c -C /tmp result
halt -p
path: /etc/rc.local
permissions: '0755'

jobs:
tests:
name: Test
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.10
with:
linux_os_versions: '["amazonlinux2", "bookworm", "noble", "jammy", "rhel-ubi9"]'
linux_build_command: "swift build"
Expand All @@ -19,13 +49,50 @@ jobs:
windows_exclude_swift_versions: '[{"swift_version": "5.9"}]'
macos_build_command: "xcrun swift build"
macos_exclude_xcode_versions: '[{"xcode_version": "16.0"}, {"xcode_version": "16.1"}]'
freebsd_build_command: "swift build"
enable_macos_checks: true
enable_ios_checks: true
enable_freebsd_checks: true
enable_linux_static_sdk_build: true
enable_wasm_sdk_build: true
enable_embedded_wasm_sdk_build: true
enable_android_sdk_build: true

openbsd:
name: OpenBSD (7.8 - amd64)
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: ghcr.io/3405691582/openbsd-swift-amd64:7.8
env:
CPU: "4"
MEM: "16G"
KVM: "-enable-kvm"
options: --device /dev/kvm
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Write cloud-init files
run: |
echo "$OPENBSD_META_DATA_CONTENT" > /usr/local/share/cidata/meta-data
echo "$OPENBSD_USER_DATA_CONTENT" > /usr/local/share/cidata/user-data

- name: Prepare cloud-init
run: |
cp -r $GITHUB_WORKSPACE /usr/local/share/cidata/repo/ && \
cat /usr/local/share/cidata/meta-data && \
cat /usr/local/share/cidata/user-data && \
ls /usr/local/share/cidata

- name: Run
run: /usr/local/bin/cmd.sh

- name: Report
run: |
ls -l /usr/local/share/tape && \
exit $(cat /usr/local/share/tape/result)

source-integrity:
name: Source integrity check
runs-on: ubuntu-latest
Expand Down
17 changes: 15 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ let package = Package(
.linkedLibrary("wasi-emulated-process-clocks", .when(platforms: [.wasi])),
.linkedLibrary("wasi-emulated-getpid", .when(platforms: [.wasi])),
.linkedLibrary("dl", .when(platforms: [.linux])),
.linkedLibrary("m", .when(platforms: [.linux, .android])),
.linkedLibrary("pthread", .when(platforms: [.linux, .custom("freebsd")])),
.linkedLibrary("m", .when(platforms: [.linux, .android, .custom("freebsd"), .openbsd])),
.linkedLibrary("pthread", .when(platforms: [.linux, .custom("freebsd"), .openbsd])),
]
),
.target(
Expand All @@ -53,3 +53,16 @@ if Context.environment["GITHUB_JOB"] != "embedded-wasm-sdk-build" {
}
}
}

// Build the library as a dylib in CI to ensure it specifies all necessary linkages
if Context.environment["CI"] == "true"
&& Context.environment["GITHUB_JOB"] != "wasm-sdk-build"
&& Context.environment["GITHUB_JOB"] != "embedded-wasm-sdk-build"
{
package.products += [
.library(
name: "SwiftToolchainCSQLiteDynamic",
type: .dynamic,
targets: ["SwiftToolchainCSQLite"])
]
}
Loading