mirror of
https://github.com/apple/swift-system
synced 2026-11-22 04:30:46 +00:00
117 lines
4.3 KiB
YAML
117 lines
4.3 KiB
YAML
name: Pull request
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, synchronize, ready_for_review]
|
|
|
|
jobs:
|
|
tests:
|
|
name: Test
|
|
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.18
|
|
with:
|
|
swift_flags: "-Xbuild-tools-swiftc -DSYSTEM_CI"
|
|
linux_os_versions: '["noble", "jammy", "focal"]'
|
|
linux_exclude_swift_versions: |
|
|
[
|
|
{"swift_version": "6.1"},
|
|
{"os_version": "focal", "swift_version": "6.2"},
|
|
{"os_version": "focal", "swift_version": "6.3"},
|
|
{"os_version": "focal", "swift_version": "6.4"},
|
|
{"os_version": "focal", "swift_version": "nightly-6.4.x"},
|
|
{"os_version": "focal", "swift_version": "nightly-main"},
|
|
]
|
|
enable_macos_checks: true
|
|
macos_exclude_xcode_versions: |
|
|
[
|
|
{"xcode_version": "swift_6.1"},
|
|
]
|
|
windows_exclude_swift_versions: |
|
|
[
|
|
{"swift_version": "6.1"},
|
|
]
|
|
enable_linux_static_sdk_build: true
|
|
linux_static_sdk_exclude_swift_versions: |
|
|
[
|
|
{"os_version": "focal", "swift_version": "nightly-6.4.x"},
|
|
{"os_version": "focal", "swift_version": "6.4"},
|
|
{"os_version": "focal", "swift_version": "nightly-main"},
|
|
]
|
|
enable_wasm_sdk_build: true
|
|
wasm_exclude_swift_versions: |
|
|
[
|
|
{"os_version": "focal", "swift_version": "nightly-6.4.x"},
|
|
{"os_version": "focal", "swift_version": "6.4"},
|
|
{"os_version": "focal", "swift_version": "nightly-main"},
|
|
]
|
|
enable_android_sdk_build: true
|
|
enable_android_sdk_checks: true
|
|
enable_freebsd_checks: true
|
|
|
|
build-abi-stable:
|
|
name: Build ABI Stable
|
|
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.18
|
|
with:
|
|
enable_linux_checks: false
|
|
enable_macos_checks: true
|
|
macos_exclude_xcode_versions: |
|
|
[
|
|
{"xcode_version": "swift_6.1"},
|
|
]
|
|
enable_windows_checks: false
|
|
# Only build
|
|
macos_build_command: "xcrun swift build --build-tests"
|
|
# Enable availability to match ABI stable verion of system.
|
|
swift_flags: "-Xbuild-tools-swiftc -DSYSTEM_CI -Xbuild-tools-swiftc -DSYSTEM_ABI_STABLE"
|
|
|
|
cmake_build:
|
|
name: CMake Validation
|
|
runs-on: ubuntu-latest
|
|
container: swiftlang/swift:nightly-main-noble
|
|
steps:
|
|
- name: Copy Sources
|
|
uses: actions/checkout@v6
|
|
- name: Install Dependencies
|
|
shell: bash
|
|
run: |
|
|
apt update && apt install -y curl ninja-build jq
|
|
curl -fsSL "https://github.com/Kitware/CMake/releases/download/v4.0.2/cmake-4.0.2-linux-$(uname -m).tar.gz" \
|
|
| tar --strip-components=1 -xz -C /usr/local
|
|
- name: Configure Project
|
|
shell: bash
|
|
run: |
|
|
mkdir -p build/.cmake/api/v1/query
|
|
touch build/.cmake/api/v1/query/codemodel-v2
|
|
cmake -G 'Ninja' -B build -S . -DCMAKE_C_COMPILER=clang -DCMAKE_Swift_COMPILER=swiftc -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=YES
|
|
- name: Validate CMake File Lists
|
|
shell: bash
|
|
run: |
|
|
swift package describe --type json > /tmp/swiftpm.json
|
|
cat build/.cmake/api/v1/reply/target-SystemPackage-*.json > /tmp/cmake.json
|
|
jq '.targets[] | select(.name == "SystemPackage") | .sources[]' /tmp/swiftpm.json | sort > /tmp/swiftpm-list.txt
|
|
jq '.sources[].path[15:]' /tmp/cmake.json | sort > /tmp/cmake-list.txt
|
|
comm -23 /tmp/swiftpm-list.txt /tmp/cmake-list.txt > /tmp/missing.txt
|
|
if [ -s /tmp/missing.txt ]; then
|
|
echo "::error::SystemPackage CMakeLists.txt does not match SwiftPM. Missing sources:"
|
|
cat /tmp/missing.txt
|
|
exit 1
|
|
fi
|
|
echo "::notice::SystemPackage CMakeLists.txt matches SwiftPM"
|
|
- name: Build Project with CMake
|
|
shell: bash
|
|
run: cmake --build build
|
|
|
|
soundness:
|
|
name: Soundness
|
|
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@0.0.18
|
|
with:
|
|
license_header_check_project_name: "Swift.org"
|
|
# https://github.com/apple/swift-system/issues/224
|
|
docs_check_enabled: false
|
|
unacceptable_language_check_enabled: false
|
|
license_header_check_enabled: false
|
|
format_check_enabled: false
|
|
python_lint_check_enabled: false
|