mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Add Swift-version-based inputs to macOS CI workflows ### Motivation - The macOS CI runners now provide symbolic links mapping Swift versions to Xcode apps ( `Xcode_swift_6.1.app`, `Xcode_swift_6.2.app`, `Xcode_swift_6.3.app`), decoupling CI from specific Xcode versions. - Several Xcode versions (`16.3`, `26.0`, `26.1`, `26.2`) are being deprecated and removed from runners. - The `-require-explicit-sendable` build argument overrides on Xcode 16.2/16.3 are no longer needed. ### Modifications - Added `swift_6_1_enabled`, `swift_6_2_enabled`, `swift_6_3_enabled` inputs (with corresponding `build_arguments_override`, `test_arguments_override`, setup_command) to `macos_tests.yml`, all defaulting to false. - Added macos_ `swift_6_1_enabled`, macos_ `swift_6_2_enabled`, macos_ `swift_6_3_enabled` inputs to `macos_benchmarks.yml`. - Added matrix entries using the `Xcode_swift_6.X.app` symlink paths. - All existing `xcode_*` inputs remain unchanged for backwards compatibility with downstream consumers. - Enabled the new Swift-version inputs in main.yml and pull_request.yml, removing the old `xcode_16_2/16_3` build argument overrides. ### Result - SwiftNIO CI now runs macOS jobs for Swift `6.1`, `6.2`, and `6.3` using the stable `Xcode_swift_6.X.app` symlinks. - Downstream consumers are unaffected. An example of this working here https://github.com/apple/swift-nio/actions/runs/22960228328/job/66648462048?pr=3546
123 lines
4.6 KiB
YAML
123 lines
4.6 KiB
YAML
name: PR
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
|
|
jobs:
|
|
soundness:
|
|
name: Soundness
|
|
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@0.0.7
|
|
with:
|
|
license_header_check_project_name: "SwiftNIO"
|
|
# Workaround https://github.com/swiftlang/swift-docc/issues/1280
|
|
docs_check_container_image: "swift:6.1-noble"
|
|
|
|
unit-tests:
|
|
name: Unit tests
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
|
|
with:
|
|
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
|
|
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
|
|
linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
|
|
linux_6_2_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
|
|
linux_nightly_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
|
|
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
|
|
|
|
benchmarks:
|
|
name: Benchmarks
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
|
|
with:
|
|
benchmark_package_path: "Benchmarks"
|
|
|
|
cxx-interop:
|
|
name: Cxx interop
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
|
|
|
|
construct-integration-test-matrix:
|
|
name: Construct integration test matrix
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- id: generate-matrix
|
|
run: echo "integration-test-matrix=$(curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
|
|
env:
|
|
MATRIX_LINUX_SETUP_COMMAND: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq"
|
|
MATRIX_LINUX_COMMAND: "./scripts/integration_tests.sh"
|
|
MATRIX_LINUX_ENV_VARS_JSON: '{"NIO_ALLOC_COUNTER_TESTS_PARALLEL": "true"}'
|
|
|
|
integration-tests:
|
|
name: Integration tests
|
|
needs: construct-integration-test-matrix
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
|
|
with:
|
|
name: "Integration tests"
|
|
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
|
|
|
|
vsock-tests:
|
|
name: Vsock tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Load vsock_loopback kernel module
|
|
run: sudo modprobe vsock_loopback
|
|
- name: Build package tests
|
|
run: swift build --build-tests
|
|
- name: Run Vsock tests
|
|
shell: bash # explicitly choose bash, which ensures -o pipefail
|
|
run: swift test --filter "(?i)vsock" | tee test.out
|
|
- name: Check for skipped tests
|
|
run: test -r test.out && ! grep -i skipped test.out
|
|
|
|
macos-tests:
|
|
name: macOS tests
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
|
|
with:
|
|
runner_pool: general
|
|
build_scheme: swift-nio-Package
|
|
xcode_16_3_enabled: false
|
|
xcode_16_4_enabled: false
|
|
xcode_26_0_enabled: false
|
|
xcode_26_1_enabled: false
|
|
xcode_26_2_enabled: false
|
|
swift_6_1_enabled: true
|
|
swift_6_2_enabled: true
|
|
swift_6_3_enabled: true
|
|
|
|
static-sdk:
|
|
name: Static Linux Swift SDK
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main
|
|
|
|
wasm-sdk:
|
|
name: WebAssembly Swift SDK
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/wasm_swift_sdk.yml@main
|
|
with:
|
|
additional_command_arguments: "--target NIOCore"
|
|
|
|
android-sdk:
|
|
name: Android Swift SDK
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/android_swift_sdk.yml@main
|
|
|
|
release-builds:
|
|
name: Release builds
|
|
uses: apple/swift-nio/.github/workflows/release_builds.yml@main
|