Files
swift-nio/.github/workflows/pull_request.yml
T
2026-02-20 18:01:00 +00:00

184 lines
7.7 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@matrix_fan_out_fan_in
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"
unit-tests-required:
name: Unit tests (All Required)
runs-on: ubuntu-latest
needs: [unit-tests]
if: always()
steps:
- name: Check required jobs
run: |
if [[ "${{ needs.unit-tests.result }}" != "success" && \
"${{ needs.unit-tests.result }}" != "skipped" ]]; then
echo "One or more required unit test matrix jobs failed."
echo "By default, stable versions are required and nightly versions are not."
echo "To diagnose, expand the 'Unit tests' job above and look for failing matrix entries."
echo "To change which versions are required, see the linux_*_required / windows_*_required inputs in .github/workflows/unit_tests.yml."
exit 1
fi
benchmarks:
name: Benchmarks
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/benchmarks.yml@matrix_fan_out_fan_in
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@matrix_fan_out_fan_in
cxx-interop-required:
name: Cxx interop (All Required)
runs-on: ubuntu-latest
needs: [cxx-interop]
if: always()
steps:
- name: Check required jobs
run: |
if [[ "${{ needs.cxx-interop.result }}" != "success" && \
"${{ needs.cxx-interop.result }}" != "skipped" ]]; then
echo "One or more required Cxx interop matrix jobs failed."
echo "By default, stable versions are required and nightly versions are not."
echo "To diagnose, expand the 'Cxx interop' job above and look for failing matrix entries."
echo "To change which versions are required, see the linux_*_required inputs in .github/workflows/cxx_interop.yml."
exit 1
fi
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/matrix_fan_out_fan_in/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"
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@matrix_fan_out_fan_in
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@matrix_fan_out_fan_in
with:
runner_pool: general
build_scheme: swift-nio-Package
xcode_16_2_build_arguments_override: "-Xswiftc -Xfrontend -Xswiftc -require-explicit-sendable"
xcode_16_3_build_arguments_override: "-Xswiftc -Xfrontend -Xswiftc -require-explicit-sendable"
macos-tests-required:
name: macOS tests (All Required)
runs-on: ubuntu-latest
needs: [macos-tests]
if: always()
steps:
- name: Check required jobs
run: |
if [[ "${{ needs.macos-tests.result }}" != "success" && \
"${{ needs.macos-tests.result }}" != "skipped" ]]; then
echo "One or more required macOS test matrix jobs failed."
echo "By default, stable Xcode versions are required and beta versions are not."
echo "To diagnose, expand the 'macOS tests' job above and look for failing matrix entries."
echo "To change which versions are required, see the xcode_*_required inputs in .github/workflows/macos_tests.yml."
exit 1
fi
static-sdk:
name: Static Linux Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/static_sdk.yml@matrix_fan_out_fan_in
wasm-sdk:
name: WebAssembly Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/wasm_swift_sdk.yml@matrix_fan_out_fan_in
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@matrix_fan_out_fan_in
release-builds:
name: Release builds
uses: apple/swift-nio/.github/workflows/release_builds.yml@matrix_fan_out_fan_in
release-builds-required:
name: Release builds (All Required)
runs-on: ubuntu-latest
needs: [release-builds]
if: always()
steps:
- name: Check required jobs
run: |
if [[ "${{ needs.release-builds.result }}" != "success" && \
"${{ needs.release-builds.result }}" != "skipped" ]]; then
echo "One or more required release build matrix jobs failed."
echo "By default, stable versions are required and nightly versions are not."
echo "To diagnose, expand the 'Release builds' job above and look for failing matrix entries."
echo "To change which versions are required, see the linux_*_required / windows_*_required inputs in .github/workflows/release_builds.yml."
exit 1
fi