diff --git a/.github/workflows/reusable_pull_request.yml b/.github/workflows/reusable_pull_request.yml index 751da8ec64..5f22852839 100644 --- a/.github/workflows/reusable_pull_request.yml +++ b/.github/workflows/reusable_pull_request.yml @@ -6,7 +6,14 @@ on: unit_tests_linux_enabled: type: boolean description: "Boolean to enable the unit tests linux job. Defaults to true." + benchmarks_linux_enabled: + type: boolean + description: "Boolean to enable the benchmarks linux job. Defaults to true." default: true + benchmarks_linux_package_path: + type: string + description: "Path to the package containing the benchmarks. Defaults to the repository root." + default: "." api_breakage_check_enabled: type: boolean description: "Boolean to enable the API breakage check job. Defaults to true." @@ -51,6 +58,36 @@ jobs: uses: actions/checkout@v4 - name: Run tests run: swift test + + benchmarks-linux: + name: Benchmarks + if: ${{ inputs.benchmarks_linux_enabled }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + swift: + - image: swift:5.8-jammy + swift_version: 5.8 + - image: swift:5.9-jammy + swift_version: 5.9 + - image: swift:5.10-noble + swift_version: 5.10 + - image: swiftlang/swift:nightly-6.0-jammy + swift_version: nightly-next + - image: swiftlang/swift:nightly-main-jammy + swift_version: nightly-main + container: + image: ${{ matrix.swift.image }} + timeout-minutes: 20 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run tests + env: + PACKAGE_PATH: ${{ inputs.benchmarks_linux_package_path }} + SWIFT_VERSION: ${{ matrix.swift.swift_version }} + run: swift package --package-path ${PACKAGE_PATH} benchmark --disable-sandbox baseline check --check-absolute-path Thresholds/$${SWIFT_VERSION-}/ api-breakage-check: name: API breakage check diff --git a/Benchmarks/Thresholds/main/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json b/Benchmarks/Thresholds/nightly-main/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json similarity index 100% rename from Benchmarks/Thresholds/main/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json rename to Benchmarks/Thresholds/nightly-main/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json diff --git a/Benchmarks/Thresholds/main/NIOPosixBenchmarks.TCPEcho.p90.json b/Benchmarks/Thresholds/nightly-main/NIOPosixBenchmarks.TCPEcho.p90.json similarity index 100% rename from Benchmarks/Thresholds/main/NIOPosixBenchmarks.TCPEcho.p90.json rename to Benchmarks/Thresholds/nightly-main/NIOPosixBenchmarks.TCPEcho.p90.json diff --git a/Benchmarks/Thresholds/main/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json b/Benchmarks/Thresholds/nightly-main/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json similarity index 100% rename from Benchmarks/Thresholds/main/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json rename to Benchmarks/Thresholds/nightly-main/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json diff --git a/Benchmarks/Thresholds/nightly-next/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json b/Benchmarks/Thresholds/nightly-next/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json new file mode 100644 index 0000000000..4a3c90c5f3 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-next/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 12 +} diff --git a/Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEcho.p90.json b/Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEcho.p90.json new file mode 100644 index 0000000000..c6a93680d0 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEcho.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 108 +} diff --git a/Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json b/Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json new file mode 100644 index 0000000000..361ee44ab6 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-next/NIOPosixBenchmarks.TCPEchoAsyncChannel.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 165000 +}